WPML
wpml_mail_enabled
Type
filter
Category
Miscellaneous
WPML Version
4.9.3

Description

Use this filter to control whether WPML sends its notification emails. If needed, you can also target specific email types and prevent only those from being sent.

Arguments

$enabled
(bool) (Required) Whether WPML should send the email. Default true.

$args
(array) (Required) Data about the email being sent.

  • $to (string) The email recipient.
  • $subject (string) The email subject line.
  • $message (string) The email body content.
  • $headers (string|array) The email headers.
  • $attachments (array) Any file attachments.
  • $group (string) An identifier for the type of email. WPML uses the following built-in groups:
    • ate-request-activation – Sent when a user requests activation of the Automatic Translation Engine.
    • jobs-summary-report – A summary report of pending or completed translation jobs.
    • overdue-jobs-report – A report listing translation jobs that have passed their deadline.
    • batch-report – A report on the status of a translation batch.
    • translation-manager-instructions – Instructions sent by a Translation Manager to translators.

Example usage

Add the code to your theme’s functions.php file or a custom plugin.

Example 1: Disable all emails sent by WPML

add_filter( 'wpml_mail_enabled', '__return_false' );

Example 2: Disable emails from a specific group

add_filter( 'wpml_mail_enabled', function( $args ) {
    return $args['group'] !== 'jobs-summary-report';
} );

icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_forms_config_wpforms, wpml_tf_feedback_open_link

All 30 Miscellaneous hooks →