Change Password notification text on mail

If I understand you correctly, then you only want to change the text of the mail. This you can do via the filter hook password_change_email. No need to redeclare the function, which you actually can’t do. Below you find an example on how to use the password_change_email filter to change your message text. add_filter( ‘password_change_email’, … Read more

wp_mail recipient array not sending?

There are multiple ways of doing this. You can consider any of the following. 1.My preferred: foreach($group_emails as $email_address) { wp_mail($email_address, ‘my subject’, ‘my message’, $headers); } 2.Another way Define the array as follows. $group_emails = array(‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’ ); And then try your regular procedure: wp_mail($group_emails, ‘my … Read more

Few chars getting replaced with ‘=’ in mail content in wp_mail()

Commenting couple of return statements and replacing them as suggested in the below link on wordpress.org worked for me, now the mails are sent properly and the equal sign ‘=’ issue is solved. Fixed by making following changes in wp-includes\class-phpmailer.php public function encodeQP($string, $line_max = 76) { // Use native function if it’s available (>= … Read more

Dynamically send pdf attached to post with contact form 7 [closed]

Try this instead. There was some internal restructuring in CF7 3.9. add_action(‘wpcf7_before_send_mail’,’send_pdf’); function send_pdf( $cf7 ) { $id = $cf7->id(); if ($id==741){ $submission = WPCF7_Submission::get_instance(); $submission->add_uploaded_file(‘pdf’, get_template_directory().’/test.pdf’); } } This should work.

How to auto send email when publishing a custom post type?

Hook into transition_post_status, fetch the users and send an email to all users. Sample code, not tested: add_action( ‘transition_post_status’, ‘send_mails_on_publish’, 10, 3 ); function send_mails_on_publish( $new_status, $old_status, $post ) { if ( ‘publish’ !== $new_status or ‘publish’ === $old_status or ‘my_custom_type’ !== get_post_type( $post ) ) return; $subscribers = get_users( array ( ‘role’ => ‘subscriber’ … Read more

Custom post type without editor or revisions – Notify on update?

If you publish a post, also custom post type, the hook get form status and post_type – {$new_status}_{$post->post_type} – is active and you can use this hook for send an mail. As an examaple for publish music: add_action(‘publish_music’, ‘fb_my_function’); You can also send the revision inside the mail, the revision is only a other post … Read more

Buddypress send email notification only if user is not logged in [closed]

One thing you can do is to filter $email_to and return empty string if the recipient is logged in. This way wp_mail() will fail to send the message and return false. Add the following to theme functions.php or to bp-custom.php file: add_filter(‘messages_notification_new_message_to’, ‘disable_loggedin_email_notification’); function disable_loggedin_email_notification($email_to) { $user = get_user_by(’email’,$email_to); if (bp_has_members(“type=online&include=$user->ID”)) { $email_to = ”; … Read more