• Resolved stardeuche

    (@stardeuche)


    Hi,

    I’m using your plugin for customize emails of WP. But the sender of the email is, for my use case, WordPress <wordpress@monsupersite.com>. Ideally, i want see that in my email : Mon Super Site <admin@monsupersite.com>

    Is it possible to change this parameter with a filter or hook of your plugin ? Perhaps this filter bnfw_from_field( $value, $setting, $post_id, $emails ).

    Can i use this filter with the free version of your plugin ?

    Thanks so lot

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jack – BNFW

    (@voltronik)

    Hi @stardeuche,
    Thanks for your message.

    You can change the ‘From’ name and email address for most of the notifications in BNFW. The only ones you can’t do this on are ones where there isn’t a filter available for that particular email within WordPress. That being said, there is a blanket approach with a caveat, which you can read about here: https://betternotificationsforwp.com/documentation/compatibility/changing-name-email-transactional-notifications/

    Hope this helps.

    Thread Starter stardeuche

    (@stardeuche)

    @voltronik thanks 🙂

    I’m reading your post. It’s very interesting.

    Perhaps i can use the filter with this code ? This code will change the ‘From’ name and email address for the notification created with your plugin.

    
    function bnfw_change_email_address($email) {
    $obj = get_post_type_object( 'bnfw_notification' );
    if($obj->labels->name == 'bnfw_notification') {
      $email = "email@yourdomain.com";
    }
    return $email;
    }
    add_filter('wp_mail_from', 'bnfw_change_email_address');
    
    Plugin Author Jack – BNFW

    (@voltronik)

    Hi @stardeuche,
    The filter on the page I linked to in my last reply comes with the following caveat:

    Please be aware though, that by doing this, you may globally affect all notifications that WordPress sends out, possibly including those from BNFW too. Please test appropriately before adding the below code to your website.

    So changing the from name and email address using a filter will apply to all emails from your WordPress website, not just those from BNFW, and will override any other settings you have in other BNFW notifications too.

    • This reply was modified 4 years, 10 months ago by Jack - BNFW.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘change default sender sent email’ is closed to new replies.