Help with filter for wp_notify_moderator()
comment_moderation_recipients filter is not in wordpress 3.6. check link : http://wpseek.com/wp_notify_moderator/ you will find following line. WORDPRESS 3.7-ALPHA-25157
comment_moderation_recipients filter is not in wordpress 3.6. check link : http://wpseek.com/wp_notify_moderator/ you will find following line. WORDPRESS 3.7-ALPHA-25157
try this one add_filter(‘wp_mail_from’, ‘doEmailFilter’); add_filter(‘wp_mail_from_name’, ‘doEmailNameFilter’); function doEmailFilter($email_address){ if($email_address === “[email protected]”) return ‘[email protected]’; else return $email_address; } function doEmailNameFilter($email_from){ if($email_from === “WordPress”) return ‘MySite.com’; else return $email_from; } This checks if WP is going to send mail as a system (as wordpress@something) and if so, changes to your setting. Otherwise, is using inputs data … Read more
You are passing the content of the message through the strip_tags() function. The result is the content of the email with the HTML tags striped. Try not using that function.
You have a typo in your code, the function is __() with two underscores. You will also need to configure the textdomain ‘text-domain’ and have a valid translation for the end users’ browser settings for it to not default to english. // use two underscores in the method $message = __(“Hello Admin,”,’text-domain’); // assuming this … Read more
Ok even your question is difficult to read, here we go with I understand: If you want to send one message to multiple email address you have more than one options but lets see two most used: // FIRST // One message to many addresses, this one is simplest, but every person will see each … Read more
send_password_change_email and send_email_change_email are the filters used for sending the user an email, if they change their password or an account has been created for them. It is not responsible for the “New user registration on your site” mail. The function that does this is wp_new_user_notification(), which is actually one of the pluggable functions. You … Read more
Although wp_mail returns false on failure, it does also contain an action hook to allow you access to error information. If phpmailer fails to send, these lines run: /** * Fires after a phpmailerException is caught. * * @since 4.4.0 * * @param WP_Error $error A WP_Error object with the phpmailerException message, and an array … Read more
I would suggest using AJAX for this. You could do something like this for the jQuery part: <script type=”text/javascript”> jQuery(document).ready(function($) { // Execute when user clicks on the “Submit” button $(‘#SUBMIT_BUTTON_ID’).on(‘click’, function(e) { e.preventDefault(); var email = $(‘input[name=email]’).val(); var firstname = $(‘input[name=firstname]’).val(); var familyname = $(‘input[name=familyname]’).val(); var other_names = $(‘input[name=other_names]’).val(); var dob_day = $(‘input[name=dob_day]’).val(); var … Read more
Here’s your problem: $body = file_get_contents( get_stylesheet_directory() . ‘/templates/email/event-creator-notification.php’); file_get_contents literally just gets the contents of that file. There’s no PHP execution. Instead, if you want to get the output of something as a variable, use output buffers, e.g. ob_start(); // everything echo’d after this gets put in the buffer get_template_part( ‘templates/email/event-creator-notification’ ); $body = … Read more
You could use the transition_post_status hook instead, as it already knows what the current and previous status of the post are. <?php add_action(‘transition_post_status’, ‘wpse_366380_email_on_publish’, 10, 3); function wpse_366380_email_on_publish( $new_status, $old_status, $post ) { // Only if this post was just published, and previously it was either // “auto-draft” (brand new) or “pending” (not yet published) … Read more