Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows how to set the "reply-to" header on a Participants Database email template
<?php
/**
* Plugin Name: PDB Set Reply-To Header
* Description: sets the reply-to header for a Participants Database email template
*/
add_filter( 'pdb-template_email_header', 'xnau_add_reply_to_header', 20, 2 );
/**
* adds a reply-to header to a Participants Database email template
*
* @param string $header the email header
* @param string $context the context identifier
* @return string the header
*/
function xnau_add_reply_to_header( $header, $context )
{
// this is the reply to name/email to use
$replyto = 'Email Address <emailaddress@email.co>';
/*
* the test we do here is to determine if the outgoing email
* should have the header added
*/
if ( strpos( $header, '@xnau.com' ) ) {
$header .= "\n" . 'Reply-To: ' . $replyto;
}
return $header;
}
@xnau

This comment has been minimized.

Copy link
Owner Author

commented Feb 27, 2019

The test we do on line 24 is so we don't add that header to all outgoing Participants Database emails. You will need to adjust it so that it identifies an email that needs the header added in your particular case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.