When setting up email notifications on child posts to be sent to the parent post author, I have a hook in my functions files and on the form the email is set to be sent to site admin with 'bcc' selected.
Has a new/different method been developed over the past year or so by any chance? The reason I ask is that a 'bcc' field means that no recipients should see any of the recipients addresses if they're in the 'bcc' field but this isn't working; whether the email is viewed by the parent post author on a mobile device or desktop, the bcc field contents are displayed. I've tested by sending an email from a hotmail account to a gmail account with a recipient in the bcc field and the recipient couldn't see that field. This is how it should be with emails generated by forms.
Please advise. Thanks.
Can you tell me more about how you are adding the bcc address(es)? What specific hook code are you referring to? I just ran a quick test with two addresses in the "Send notification to a specific address" field, like this:
email1@domain.com,bcc:email2@domain.com
The email1 address received the email with no indication that email2 received the same email.
The email2 address also received the email, and is able to see that the email was originally sent to email1.
So it seems to be behaving as expected in this simple example.
Hi Christian
I'm adding Site Admin email address to the 'Wordpress user' field (see image). This is the only email address on the form. I then have this hook to send the email to the parent post author :-
add_filter('cred_notification_recipients', 'ts_cred_notification_recipient_524', 10, 4);
function ts_cred_notification_recipient_524($recipients, $notification, $form_id, $post_id){
//this is the form ID
if (524 == $form_id){
$parent_post_id = toolset_get_related_post($post_id, 'garden-plant' );
$post_email = get_post_meta($parent_post_id, 'wpcf-garden-owner-email', true);
$recipients[] = array('to'=>'to', 'name'=>'', 'lastname'=>'', 'address'=>$post_email );
}
return $recipients;
}
I've tried it again just now on a new install and it doesn't matter which field I put the bcc email address in on the form, the parent post author can see the bcc address on my mobile device and in gmail (see images). The bcc email isn't displayed in hotmail.
I have some concerns about this for my actual site because it looks like I'm spying on my users!! I had sort of concluded this isn't a Toolset issue given the different display in hotmail but I'm puzzled that you can't replicate this.
I have a back-up plan that will make this a little less like spying but it's not ideal or I could use cc instead although from the User's point of view, they may wonder why a copy is being sent to the Site Admin address and that doesn't do much for trust levels.
Is there any other way of emailing a notification to the parent post author from the child post to get round this?
The bcc email isn't displayed in hotmail.
You use an SMTP plugin, right? In the example you're showing above, are the email "from" account and the post author's email account linked in Google in any way? What about in the SMTP configurations, is the post author account linked to any accounts used in your SMTP plugin settings? It should not be possible to see a BCC address, unless you are also the sender of the email. It may also be possible if the recipient and sender accounts are linked somehow in Google, but I'm not completely certain.
Well I never - that's exactly why the bcc field is showing! Thank you so much for making the connection 🙂