Posted by web506 on January 7, 2010 at 9:10pm
6 followers
Jump to:
| Project: | Email Field |
| Version: | 7.x-1.0 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I would like to see if there is a way to BCC me from the CCK Email Field Contact Form. I tried the Rules Module but I don't know which or how to add the necessary tokens to copy the contents of the Email Form in my Rules Email. Please let me know if there is an easy way around this. Thanks!
Chalo
Comments
#1
Hi, well after a while, I figured it out.
you have to add this piece of code to the module cck email
1- open the file email.module
2- look for this: function email_mail($key, &$message, $params)
3- find this piece of code
// Prepare the body:
$message['body'] = implode("\n\n", $msg);
and add the code below just underneath it.
add the following code below the
$message['headers'] += array(
'Bcc' => 'you@yoursite.com'
);
4- upload the module
I hope this helps!!!
#2
instead of altering email module file, create a new module and implement hook_mail_alter to add a BCC Header
#3
Thank you I will try that instead.
#4
Hi Eliosh,
I am trying this, it works fine from the regular contact form in my test drupal site, but I am also trying to learn how to get a copy from a mail sent from user to user ( user contact form ) this is what I am using:
function bccmails_mail_alter(&$message) {
$message['headers'] += array(
'Bcc' => 'me@domain.com'
);
}
in the module I created. Any ideas? I will really appreciate your help.
Thanks!
#5
I am trying to accomplish the exact same thing. I look forward to seeing the exact code we need to use.
#6
@web506
What kind of errors you have?
#7
Thanks I am not having any more issues with this, this is a great module!
#8
@web506
Can you drive me how I will add the function bccmails_mail_alter(&$message)?
And where?
I would like to bcc all emails sent when a new user is created by the administrator.
How I can do this?
Regards,
Andreas
#9
Has someone created this function for 7? I would like to CC a fixed email address on all emails submitted via the contact form.
#10
In your template.php
<?phpfunction THEME_mail_alter(&$message) {
$message['headers']['CC'] = 'email@domain.com';
$message['headers']['BCC'] = 'email@domain.com';
}
?>
#11
Thanks Fly85! Works perfectly.