KI-Zusammenfassung
Beschreibung
The wpforms_emails_send_email_data filter lets you modify the raw email data before WPForms sends it. You can use this filter to change recipients, subjects, messages, headers, or attachments on a per-email basis. This filter is useful for localization, branding, or targeting specific notifications based on the recipient address, form settings, or other available data.
| Parameter | typ | beschreibung |
|---|---|---|
$data | Array | The email data array, including to, subject, message, headers, and attachments. |
$email | object | The email object instance (WPForms_WP_Emails) for the outgoing message. |
Quelle
wpforms/includes/emails/class-emails.php
Beispiel
/**
* Add a prefix to all WPForms email subjects.
*/
function wpf_dev_prefix_email_subject( $data, $email ) {
$data['subject'] = '[WPForms] ' . $data['subject'];
return $data;
}
add_filter( 'wpforms_emails_send_email_data', 'wpf_dev_prefix_email_subject', 10, 2 );