AI Summary
Would you like to customize the From Email used specifically for WPForms Email Summaries?
By default, WPForms uses your site’s admin email or the email defined by the global wpforms_emails_mailer_get_from_address filter for all outgoing messages. However, if you want to use a different From Email only for the Email Summaries, you can easily achieve this with a few lines of PHP.
In this tutorial, we’ll show you how to apply a custom From Email exclusively to the weekly Email Summaries without affecting any other WPForms emails.
By default, WPForms sends all email notifications using the same From Email address. You can change this globally with the wpforms_emails_mailer_get_from_address filter.
However, this method applies to all outgoing emails (such as form notifications, confirmations, and Email Summaries). If you only want to modify the From Email for the Email Summaries, you’ll need to target that process specifically using the code snippet below.
Adding the Code Snippet
You can use the following snippet to set a custom From Email only for Email Summaries.
If you need help with where or how to add snippets to your site, please review this tutorial.
function wpf_add_summary_from_address_filter() {
add_filter( 'wpforms_emails_mailer_get_from_address', 'wpf_set_custom_summary_from_address' );
}
add_action( 'wpforms_email_summaries_cron', 'wpf_add_summary_from_address_filter', 5 );
function wpf_set_custom_summary_from_address( $from_address ) {
// --> IMPORTANT: Change this to your desired sending email address.
// This should be an address on your domain, e.g., '[email protected]'.
return '[email protected]';
}
function wpf_remove_summary_from_address_filter() {
remove_filter( 'wpforms_emails_mailer_get_from_address', 'wpf_set_custom_summary_from_address' );
}
add_action( 'wpforms_email_summaries_cron', 'wpf_remove_summary_from_address_filter', 20 );
This code temporarily changes the From Email before the summary email is generated and restores the default value afterward.
That way, only your Email Summaries are affected — all other WPForms emails will continue using the default From Email.
And that’s it! You’ve successfully customized the From Email for WPForms Email Summaries only.
Would you like to also change the From Email for all WPForms emails? Check out our developer tutorial on how to change the global From Email address.