Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like the ability to CC and BCC webform submissions to people rather than having all recipients appear in the email "To" header. (A client requested this functionality the other day.) Thanks. :)
Comments
Comment #1
quicksketchBy using conditional e-mail recipients, each user will receive an e-mail individually, is this not suitable enough?
Comment #2
TravisCarden CreditAttribution: TravisCarden commentedThat would suffice, except that it requires every email address to be supplied as a form component. But in the case of my client, for example, they want the CEO to receive the email and the webmaster to be CC'ed, and neither one of those addresses comes from a form component. Does that make sense?
Comment #3
quicksketchYou could easily add them as recipients by creating hidden fields and then using those. Otherwise this will be implemented in #277581: Send emails with a custom/templated body (and subject, to addresses and from addresses).
Comment #4
anishvinoj CreditAttribution: anishvinoj commentedTry this way it will work
In your module folder you can find "webform.module" ,find the function theme_mail_headers in it
and add the cc as well as bcc in it under "$headers = array("
'CC' => 'xx@yyyy.com, xx1@yyyy1.com, xx2@yyyy2.com'
=>in this e.g i have mentioned how to add more cc's
like the same bcc can also be added
its working for me
if you find any alternative method for adding cc and bcc , please let me know
Regards,
Anish
Comment #5
bubsy119 CreditAttribution: bubsy119 commentedNot working for me, does anyone have another solution ?
function theme_webform_mail_headers($form_values, $node, $sid, $cid) {
$headers = array(
'X-Mailer' => 'Drupal Webform (PHP/'. phpversion() .')',
'CC' => 'my@email.com'
);
return $headers;
}