Content Monitor email is lacking in information

I'm using the Content Monitor to search my WPMU for trigger words, but all I get is an email that says xyz page possibly contains a non-allowed word.
-- It doesn't tell me what word.
-- It actually DOES contain it, not possibly contains it.
-- The email comes from Wordpress@domain.com; can I change this to make it more user-friendly?

How can I change the email to include the trigger word/phrase, update the email language, and change the email sender address?

This is a really helpful plugin, but I'd just like to make a few "upgrades" to it.

Thanks!

  • Jude

    Hi again Larry Levenson

    -- It doesn't tell me what word.

    This will take a bit of custom code to do right, also you must be willing to directly edit the plugin file.

    -- It actually DOES contain it, not possibly contains it.

    Here you go

    add_filter( 'wp_mail', 'my_wp_mail_filter' );
    function my_wp_mail_filter( $args ) {
    
    	$new_wp_mail = array(
    		'to'          => $args['to'],
    		'subject'     => $args['subject'],
    		'message'     => str_replace ( "possibly contains", "does contain" , $args['message'] ),
    		'headers'     => $args['headers'],
    		'attachments' => $args['attachments'],
    	);
    
    	return $new_wp_mail;
    }

    -- The email comes from Wordpress@domain.com; can I change this to make it more user-friendly?

    This snippet should do the trick

    // Change default WP email sender
    
    add_filter('wp_mail_from', 'new_mail_from');
    
    function new_mail_from_name($old) {
    return 'Site Administrator';
    }
    
    add_filter('wp_mail_from_name', 'new_mail_from_name');
    
    function new_mail_from($old) {
    return 'info@mydomain.com';
    }

    Insert that into either your theme's functions.php, or you can insert it as a mu-plugin.

    To create an mu-plugin, go to your /wp-content/ folder via FTP, and find the folder called "mu-plugins". If there is no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like (making sure the file as an extension of .php, e.g. example.php) and paste the code in there.

    You don't need to activate that plugin, as it will be always be automatically activated. Please be sure to add a PHP start tag at the beginning of the code if you insert this code as a mu-plugin, like this:

    <?php

    Thank you for being a WPMU DEV member and have a fantastic day!

    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.