WordPress filter hook

wpcf7_additional_mail

Fired by 5 WordPress plugins, running on 10M+ sites between them.

How to use wpcf7_additional_mail

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wpcf7_additional_mail', function( $additional_mail, $contact_form_data ) {
	// Change $additional_mail here.
	return $additional_mail;
}, 10, 2 );

Argument names come from Track Geolocation Of Users Using Contact Form 7's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire wpcf7_additional_mail

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Contact Form 7 icon Contact Form 710+ million installs apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form ) includes/submission.php:751
  2. Track Geolocation Of Users Using Contact Form 7 icon Track Geolocation Of Users Using Contact Form 7800+ installs apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form_data ) inc/lib/class.tglcf.lib.php:286
  3. Accept PayPal Payments using Contact Form 7 icon Accept PayPal Payments using Contact Form 7500+ installs apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form_data ) inc/lib/class.cf7pe.lib.php:1101
  4. Accept SagePay Payments Using Contact Form 7 icon Accept SagePay Payments Using Contact Form 710+ installs apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form_data ) inc/lib/class.cfspzw.lib.php:334
  5. Ascue icon AscueFewer than 10 installs apply_filters( 'wpcf7_additional_mail', $additional_mail, $contact_form ) includes/integrations/class-ascue-integration-cf7.php:160

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.