Forums

CF8: CC and BCC fields missing in email action

pixelhexe 05 Sep, 2023
This would be great so that using dynamic CC and BCC will be possible again.

I used it in CF 6 where the selection of a dropdown could determine the "to recipient" address as well as "cc" and "bcc" (with help of a switch action which I am missing as well).

For the general "to recipient" address I found a workaround - probably not the most elegant way but it works:

1. Load: Hidden field name "my-recipient" (default value: fall back email address).

2. Submit: PHP code ->

if($this->data["my-selection"]=="Option 1") { 
$this->data["my-recipient"] = "email1@email.com";
}
if($this->data["my-selection"]=="Option 2") { 
$this->data["my-recipient"] = "email2@email.com";
}


3. Submit: email action => field "recipient": {data:my-recipient}

But there are no fields "cc" or "bcc" which I could fill with variables.
Or is there a way to make it happen with PHP action, pure coding?

Thank you so much for your efforts!!
You need to login to be able to post a reply.