AI Summary
Description
The wpforms_emails_mailer_get_reply_to_address
filter lets you change the Reply-To email address for User Registration addon used in WPForms emails.
parameter | type | description |
---|---|---|
$reply_to | string | The current Reply-To address that WPForms is about to use. Return a different string to override it. |
$email | object | The email object instance. Provides access to email templates and properties. |
Source
wpforms/src/Emails/Mailer.php
Example
/**
* Set a custom Reply-To address for User Registration emails only.
*
* @link https://wpforms.com/developers/wpforms_emails_mailer_get_reply_to_address/
*
* @param string $reply_to Current Reply-To address.
* @param object $email The email object instance.
*
* @return string
*/
function wpf_dev_user_registration_reply_to( $reply_to, $email ) {
// Target User Registration general notifications.
if ( isset( $email->template )
&& $email->template instanceof \WPFormsUserRegistration\EmailNotifications\Templates\General ) {
// Use a dedicated inbox for replies from registration emails.
$reply_to = '[email protected]';
}
return $reply_to;
}
add_filter( 'wpforms_emails_mailer_get_reply_to_address', 'wpf_dev_user_registration_reply_to', 10, 2 );