Support

Home Forums Event Espresso Premium Change default email address

Change default email address

Posted: February 19, 2020 at 7:20 pm

Viewing 1 reply thread


jklingaman

February 19, 2020 at 7:20 pm

Below is code that I have in Astra Child: functions.php and it works perfectly for learndash notifications.

However, when I send emails from event espresso it’s sending them from my domain name and not using the function below. How do I fix that? I need all emails coming from the same place.

// Change default WordPress email address
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
return 'learning@change.tyson.com';
}
function new_mail_from_name($old) {
return 'change.tyson.com';
}


Tony

  • Support Staff

February 20, 2020 at 5:24 am

Hi there,

Event Espresso intentioned hooks into wp_mail_* at a later priority to try and prevent some of the weird and wonderful issues caused but others plugins and allow our users to manage the settings from the admin.

You can either change the above in Event Espresso -> General Settings -> You Organization (‘Organization name’ and ‘Primary Contact Email’)

Or change your above function to use a later priority, EE uses 100, so change yours to say 110.

// Change default WordPress email address
add_filter('wp_mail_from', 'new_mail_from', 110);
add_filter('wp_mail_from_name', 'new_mail_from_name', 110);

(Personally I’d recommend doing this within the setting themselves so you don’t have settings as X, replaced in emails for Y, but then X used in various other sections EE would use those values).

Viewing 1 reply thread

The support post ‘Change default email address’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso