• Resolved projectmiso

    (@projectmiso)


    Hi,

    I have a business requirement for our website https://www.hcny.com where we need to allow scenarios where different FROM Email(s) need to be set for some emails going out from the website instead of the from address listed in the plugin’s settings page.

    Is there a hook or any other method/approach where we can override the default from email saved in the settings page?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter projectmiso

    (@projectmiso)

    I should have researched some more. The checkbox “Force From Name Replacement” was responsible for the override to not work. Once unchecked, the override (WP hooks) are now working.

    Here is a basic example code if anyone is interested.

    add_filter( 'wp_mail_from', 'my_mail_from' );
    function my_mail_from( $email ) {
        return "[email protected]";
    }
    add_filter( 'wp_mail_from_name', 'my_mail_from_name' );
    function my_mail_from_name( $name ) {
        return "Your Preferred Name";
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Need to set different FROM address for different emails’ is closed to new replies.