Support » Plugin: AsynCRONous bbPress Subscriptions » Change “reply to” email address

  • Resolved 2cats

    (@2cats)


    Hi, your plugin is working great except that the default reply-to address has changed from noreply@domain.net to my administrative email address. I saw your instructions:

    bbp_subscription_email_from( $from ) // $from can be a string or array(‘name’=>string, ‘address’=>string)

    I am afraid I am not expert enough to know how to correctly insert this into my functions file. Could you please give me a specific example, using $from to be the organization name, and the noreply@domain.net? I have added this code already and it works like a charm:

    add_filter( ‘bbp_forum_subscription_email_subject’, function( $subject, $forum_id, $topic_id ) {
    $blog_name = get_bloginfo( ‘name’ );
    $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );
    $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
    return “[$blog_name] New topic: $topic_title by $topic_author_display_name”;
    }, 10, 3);

    Thanks so much, I really appreciate this plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Markus Echterhoff

    (@mechter)

    Sure, try this:

    add_filter( 'bbp_subscription_email_from', function( $s ) { return 'noreply@domain.net'; }, 10, 1 );

    Thread Starter 2cats

    (@2cats)

    Thank you! And thanks so much for being available on a Sunday!!

    Plugin Author Markus Echterhoff

    (@mechter)

    No problem. I’m glad I could help. 🙂

    Thread Starter 2cats

    (@2cats)

    Hi Markus, don’t know if I should add to this one or start a new topic. The “new topic” notifications still have a reply-to of my administrative email address. Do I need to add a line to the “new topic” info? Here’s what I have in my functions file — thanks again.

    add_filter( 'bbp_forum_subscription_email_subject', function( $subject, $forum_id, $topic_id ) {
        $blog_name = get_bloginfo( 'name' );
        $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id );
        $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES );
        return "[$blog_name] New topic: $topic_title by $topic_author_display_name";
    }, 10, 3); 
    add_filter( 'bbp_subscription_email_from', 'noreply@domain.net', 10, 1 );
    Plugin Author Markus Echterhoff

    (@mechter)

    Ah yes, it would seem you have copied my code from before I fixed it (or perhaps from a notification email). I hadn’t written WordPress code in a while and made a mistake that I quickly remedied (about a minute or so after first posting it), but apparently not quickly enough.

    Please use the code from my first reply as it appears now and everything should be working as expected. Let me know should anything go awry again.

    Thread Starter 2cats

    (@2cats)

    Okay, I’ve plugged it in. Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change “reply to” email address’ is closed to new replies.