• Resolved blctech

    (@blctech)


    Is there any way to place a static “From” email address in the emails that subscribe2 sends out. We don’t want the email address of the authors going out. Is the only way to do it is via the API and remove the From field?

    s2_email_headers – This hook allows you to alter or remove the email headers subscribe2 uses at the time of sending. Headers include ‘From’, ‘Reply-To’, ‘Return-path’, ‘Precedence’ and ‘Content-Type’. If your hosting provider does not allow use of the ‘Reply-To’ header you an use code like this:
    function my_s2_headers($header) {
    unset($header[‘Reply-To’]);
    return $header;
    }
    add_filter(‘s2_email_headers’, ‘my_s2_headers’);

Viewing 1 replies (of 1 total)
  • @blctech

    Sure, you’d use that same hook but swap the function code, something like this:

    function my_s2_headers($header) {
        $header['From'] = 'My Display Name <my.email.here@example.com>';
        return $header;
    }
    add_filter('s2_email_headers', 'my_s2_headers');
Viewing 1 replies (of 1 total)

The topic ‘From address in emails’ is closed to new replies.