• Resolved berkelmudez

    (@berkelmudez)


    Hi,

    I need to change the from_email since it’s not supposed to come from the same email I use as admin.

    In the file ‘class-mailtpl.php’ I changed the mail manually like so:

    public static function defaults() {
    		return apply_filters( 'mailtpl/defaults_opts', array(
    			'from_name'         => get_bloginfo('name'),
    			'from_email'        => '[email protected]',//get_bloginfo('admin_email')
                    ));
    }

    Now it send from the email I want it to send from.
    But I know this is the wrong way to do it, as it’ll get overwritten once it updates.
    So my question is how to do it from the functions.php with a filter or something? I don’t know how to achieve this with hooks or filters or any other proper way.

    https://ww.wp.xz.cn/plugins/email-templates/

Viewing 1 replies (of 1 total)
  • First you can change this directly on the customizer on the settings panel. If you need to use a filter simple use the one on that function like this:

    add_filter( 'mailtpl/defaults_opts' , 'mailtpl_custom_from_name');
    function mailtpl_custom_from_name( $opts ) {
        $opts['from_email'] = '[email protected]';
    
        return $opts;
    }
Viewing 1 replies (of 1 total)

The topic ‘How change from_email via function.php?’ is closed to new replies.