Notifications Reply-to

This topic contains 6 replies, has 3 voices, and was last updated by  Stiofan O’Connor 6 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #391360

    Eduardo Sanchez
    Expired Member
    Post count: 110

    Hi, Is there a way to set up a command so that when an email at Geodirectory>>Notifications>>Other emails>>email enquiry is shoot the receiver gets a BCC reply-to address automatically added?. The reason is because I want to be able to track whether the recepient replies or not to the customer.

    Thanks

    #391486

    Paolo
    Site Admin
    Post count: 31206

    Hi Asked to the developers to check if it is possible via hook, they’ll let you know asap.

    Thanks

    #391497

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    yes you can use the hook below, if you need an example just let me know.

    
    
    /**
    		 * Filter the client email headers.
    		 *
    		 * @since   1.6.1
    		 * @since 1.6.11 $headers changed from string to an array.
    		 *
    		 * @param array $headers       The email headers.
    		 * @param string $fromEmail     Sender email address.
    		 * @param string $fromEmailName Sender name.
    		 * @param string $toEmail       Receiver email address.
    		 * @param string $toEmailName   Receiver name.
    		 * @param string $to_subject    Email subject.
    		 * @param string $to_message    Email content.
    		 * @param string $extra         Not being used.
    		 * @param string $message_type  The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
    		 * @param string $post_id       The post ID.
    		 * @param string $user_id       The user ID.
    		 */
    		$headers = apply_filters( 'geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );

    Thanks,

    Stiofan

    #391603

    Eduardo Sanchez
    Expired Member
    Post count: 110

    Hi Stiofan, Paolo,

    Thank you for your support, this is what I was looking for.

    If you can help me with an example I would appreciate it, I would like to keep the current Geodirectory native “other emails” function just adding an additional reply-to address so I am unsure if the hook only needs to have a var in order to have the listing owner reply to both, the sender and myself.

    Regards,
    Eduardo

    #391654

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Eduardo,

    I don’t believe there is such a thing as a BCC reply to, so i think you would have to add your email to the normal reply to. The below code with do this, just replace “my@email.com” with your email, be sure to leave the “, ” part intact.

    
    
    add_filter('geodir_sendEmail_headers','_my_additional_reply_to',10,11);
    function _my_additional_reply_to($headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id){
    
    	if($message_type=='send_enquiry' && is_array($headers)){
    		foreach($headers as $key => $header){
    			if (strpos($header, 'Reply-To:') !== false) {
    				$headers[$key] = $header.", my@email.com";
    			}
    		}
    	}
    
    	return $headers;
    }

    Thanks,

    Stiofan

    #392080

    Eduardo Sanchez
    Expired Member
    Post count: 110

    Stiofan, Thank you for your support. It worked just as expected!

    Have a good one.

    #392126

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome! 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket