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
$enabledboolRequiredWhether WPML should send the email. Default true.$argsarrayRequiredData about the email being sent.$tostringThe email recipient.$subjectstringThe email subject line.$messagestringThe email body content.$headersstring|arrayThe email headers.$attachmentsarrayAny file attachments.$groupstringAn identifier for the type of email. WPML uses the following built-in groups:ate-request-activationSent when a user requests activation of the Automatic Translation Engine.jobs-summary-reportA summary report of pending or completed translation jobs.overdue-jobs-reportA report listing translation jobs that have passed their deadline.batch-reportA report on the status of a translation batch.translation-manager-instructionsInstructions 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'; } );