WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] WP Network - local sub site email sender name + email (2 posts)

  1. sickmind
    Member
    Posted 1 year ago #

    Hello,

    we hope for some help with our issue to override wp network global setting of sender and email address

    In class EM_Mailer and setting to wp_mail, the senders name and email comes from

    if ( $emails_ok && get_option('dbem_rsvp_mail_send_method') == 'wp_mail' ){
    			$from = get_option('dbem_mail_sender_address');
    			$headers = get_option('dbem_mail_sender_name') ? 'From: '.get_option('dbem_mail_sender_name').' <'.$from.'>':'From: '.$from;
    			if( get_option('dbem_smtp_html') ){ //create filter to change content type to html in wp_mail
    				add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
    			}
    			$send = wp_mail($receiver, $subject, $body, $headers);
    			if(!$send){
    				global $phpmailer;
    				$this->errors[] = $phpmailer->ErrorInfo;
    			}
    			return $send;

    Is it possible without breaking the plugin, to override this with a custom function, in theme´s functions.php - and we can´t use the following:

    add_filter('wp_mail_from', 'new_mail_from');
    add_filter('wp_mail_from_name', 'new_mail_from_name');
    
    function new_mail_from($old) {
    return 'email@domain.com';
    }
    function new_mail_from_name($old) {
    return get_bloginfo('name');
    }

    because this will break functionality in cf7 with reply to address.

    Hope for some help or guidance of any kind.

    Thanks,

    André

    http://wordpress.org/extend/plugins/events-manager/

  2. philipjohn
    Member
    Posted 1 year ago #

    Hiya,

    There's no way to filter that I'm afraid no.

    Instead, you'll want to look at having some way of making sure that the 'dbem_mail_sender_address' option is set to the e-mail address you'd like to use, by triggering update_option()

    Cheers,
    Phil

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.