• Resolved idave2012

    (@idave2012)


    Hi,

    I had an undesirable behaviour with Easy WP SMTP working with other plugins, where woocommerce or contact forms would set a reply-to and Easy would then append the additional reply-to email, resulting with the email having multiple reply-to’s, or the from email in addition to the reply-to email.

    To get around this, I wanted a substitute mode, where the FROM address is substituted for the REPLY-TO email address. In otherwords, the reply-to email is used if either: (1) no reply-to email is specified, or (2) the FROM email exists in the reply-to header.

    I added the following to line 100 of easy-wp-smtp.php

    if ( sizeof( $phpmailer->getReplyToAddresses() ) >= 1 ) {
    	if ( array_key_exists( $this->opts['from_email_field'], $phpmailer->getReplyToAddresses() ) ) {
    		$reply_to_emails = $phpmailer->getReplyToAddresses();
    		               unset( $reply_to_emails[ $this->opts['from_email_field' ] ] );
    		$phpmailer->clearReplyTos();
    		foreach ( $reply_to_emails as $reply_to_email => $reply_to_name ) {
    		  $phpmailer->AddReplyTo( $reply_to_email , $reply_to_name );
    		}
    		$phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
    	}
    }
    else {
    	$phpmailer->AddReplyTo( $this->opts['reply_to_email'], $from_name );
    	}

    I’d be very happy if this was added to a future build!

    • This topic was modified 4 years, 11 months ago by idave2012.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Suggestion] Reply-To Substitute Mode’ is closed to new replies.