AI Summary
Description
The wpforms_emails_mailer_get_from_name
filter allows you to customize the “From” name used in WPForms emails. For example, you may want to replace the site name with a brand name or a specific label for certain email templates.
By default, this value is pulled from the WordPress site name if no custom name is set.
parameter | type | description |
---|---|---|
$from_name | string | The current From name 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
/*
* Customize the from name address that Save and Resume addon uses
*
* @link https://wpforms.com/developers/how-to-customize-the-from-email-address-for-the-save-and-resume-addon/
*/
function save_resume_change_from_name( $from_name, $email ) {
if ( $email->template instanceof WPFormsSaveResume\Email\Templates\SaveResume ) {
// Change from name with Save and Resume email
$from_name = 'Sullie Eloso';
}
return $from_name;
}
add_action( 'wpforms_emails_mailer_get_from_name', 'save_resume_change_from_name', 10, 2 );