I setup a AWS SES SMTP and sending email work fine.
But BCC email isn’t working (I filled BCC in the PostSMTP / Message / BCC field
Is there some way to have a BCC copy of all emails sent via Offload SES to another email address?
In the docs I see there is a hook “wposes_mail_sent” which could be used for posting to a logging app or maybe Slack API or similar. I’m guessing that using this hook to send another email would be a bad idea… would create an infinite loop…
function myMailSentHook( $to, $subject, $message, $headers, $attachments ) {
// Your code here.
}
add_action( 'wposes_mail_sent', 'myMailSentHook', 10, 5 );
So, that’s not much use.
In the changelog (https://github.com/deliciousbrains/wp-offload-ses-lite)I see:
= 0.4.8 =
* Experimental support for cc: and Bcc: in custom header
* Domain verification is ok
But I can’t find any other mention of it… how do I add a BCC to a custom header?
Any help or guidance appreciated.
Thanks.
]]> $send_to = $user_email;
$subject = 'Welcome!';
$headers[] = 'Content-Type: text/html; charset=UTF-8';
$headers[] = 'From: Example Web<[email protected]>';
$headers[] = 'Reply-To: [email protected]';
$headers[] = 'Bcc: [email protected]';
$message = 'Message body.';
wp_mail( $send_to, $subject, $message, $headers );
Any ideas what it might be?
]]>I hope you are doing well.
I have a further question concerning recipients. I am using the following php code to enter recipients in the recipients field – using the shortcode {multiple-mails}:
<?php
add_filter( 'forminator_form_get_admin_email_recipients', 'wpmudev_set_multiple_mail_recipients', 10, 5 );
function wpmudev_set_multiple_mail_recipients( $email, $notification, $prepared_data, $module, $entry ) {
if( $prepared_data['form_id'] != 8489 ){
return $email;
}
if( $notification['recipients'] == '{multiple-mails}' ) {
$my_post = get_post(8644);
$mails = str_replace( '"', '', str_replace( ']', '', str_replace( '[' , '', $my_post->post_content)));
$mails = array_filter( explode( ",", $mails ), function($value) {
return ( $value !== NULL && $value !== FALSE && $value !=='' );
});
if( $mails ){
$email = $mails;
}
}
return $email;
}
This all works perfectly fine. However, I would like the recipients to receive the emails in bcc, so that they cannot see all other recipients. Therefore I added {multiple-mails} in the section advanced > BCC Emails but couldn’t get any results.
I know I am doing something wrong here and would be greatful if you could help me (again) with your great support.
Kind regards
]]>The customer and normal recipient gets the mail only once.
How can we fix this? Or is there a possibility to send a mail to two recipients without BCC?
Version 1.7.6
WordPress 6.0.2