WordPress action hook

wpml_switch_language_for_email

Fired by 15 WordPress plugins, running on 57K+ sites between them.

“Switch language for email”

How to use wpml_switch_language_for_email

It's an action: your callback runs at that point and receives 1 argument. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'wpml_switch_language_for_email', function( $arg1 ) {
	// Your code runs here.
}, 10, 1 );

Argument names come from WCFM Marketplace's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

15 plugins that fire wpml_switch_language_for_email

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

  1. WCFM icon WCFM10,000+ installs do_action( 'wpml_switch_language_for_email', $mail_to ) controllers/customers/wcfm-controller-customers-manage.php:190
  2. WCFM Membership icon WCFM Membership10,000+ installs do_action( 'wpml_switch_language_for_email', $member_user->user_email ) core/class-wcfmvm-ajax.php:474
  3. UsersWP icon UsersWP10,000+ installs do_action( 'wpml_switch_language_for_email', $to ) includes/class-emails.php:566
  4. WCFM Marketplace icon WCFM Marketplace10,000+ installs do_action( 'wpml_switch_language_for_email', $this->get_recipient() ) includes/store-emails/class-wcfmmp-email-store-new-order.php:120
  5. Sensei LMS icon Sensei LMS9,000+ installs do_action( 'wpml_switch_language_for_email', $email_address ) includes/wpml/class-email.php:53
  6. Waitlist Woocommerce ( Back in stock notifier ) icon Waitlist Woocommerce ( Back in stock notifier )4,000+ installs do_action( 'wpml_switch_language_for_email', $email ) includes/emails/class-xoo-wl-email.php:149
  7. MyRewards icon MyRewards2,000+ installs do_action( 'wpml_switch_language_for_email', $email ) assets/lws-adminpanel/include/internal/mailer.php:98
  8. Order Approval for Woocommerce icon Order Approval for Woocommerce1,000+ installs do_action( 'wpml_switch_language_for_email', $this->get_recipient() ) includes/class-wcfm-order-approval-vendor-order.php:125
  9. MarketKing icon MarketKing700+ installs do_action( 'wpml_switch_language_for_email', $email_address ) public/emails/class-marketking-new-announcement-email.php:46
  10. ELEX WordPress HelpDesk & Customer Ticketing System icon ELEX WordPress HelpDesk & Customer Ticketing System200+ installs do_action( 'wpml_switch_language_for_email', $to ) includes/class-crm-ajax-functions.php:1200
  11. CommonsBooking icon CommonsBooking200+ installs do_action( 'wpml_switch_language_for_email', $recipientUser->getEmail() ) src/Messages/Message.php:204
  12. ELEX WooCommerce Abandoned Cart Recovery with Dynamic Coupons icon ELEX WooCommerce Abandoned Cart Recovery with Dynamic Coupons100+ installs do_action( 'wpml_switch_language_for_email', $toEmail ) includes/class_elex_email_cron_action.php:85
  13. Ultimate Classified Listings icon Ultimate Classified Listings30+ installs do_action( 'wpml_switch_language_for_email', $new_agent['useremail'] ) classes/class-email.php:58
  14. Enwikuna License Manager for WooCommerce icon Enwikuna License Manager for WooCommerce20+ installs do_action( 'wpml_switch_language_for_email', $this->get_recipient() ) includes/woocommerce/emails/class-elm-wc-license-expired-email.php:98
  15. Circular Arts Network icon Circular Arts NetworkFewer than 10 installs do_action( 'wpml_switch_language_for_email', $new_agent['useremail'] ) classes/class-email.php:55

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.