WPML
PHP
wpml_mail_enabled

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

  • $enabledboolRequired

    Whether WPML should send the email. Default true.
  • $argsarrayRequired

    Data about the email being sent.
    • $tostring

      The email recipient.
    • $subjectstring

      The email subject line.
    • $messagestring

      The email body content.
    • $headersstring|array

      The email headers.
    • $attachmentsarray

      Any file attachments.
    • $groupstring

      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

PHP
add_filter( 'wpml_mail_enabled', '__return_false' );

Example 2: Disable emails from a specific group

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