Active
Project:
Email Field
Version:
7.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2010 at 21:10 UTC
Updated:
29 Apr 2013 at 13:07 UTC
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
Comment #1
web506 commentedHi, 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!!!
Comment #2
elioshinstead of altering email module file, create a new module and implement hook_mail_alter to add a BCC Header
Comment #3
web506 commentedThank you I will try that instead.
Comment #4
web506 commentedHi 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!
Comment #5
KAP10 commentedI am trying to accomplish the exact same thing. I look forward to seeing the exact code we need to use.
Comment #6
eliosh@web506
What kind of errors you have?
Comment #7
web506 commentedThanks I am not having any more issues with this, this is a great module!
Comment #8
pandreas commented@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
Comment #9
adrnand commentedHas someone created this function for 7? I would like to CC a fixed email address on all emails submitted via the contact form.
Comment #10
Fly85 commentedIn your template.php
Comment #11
adrnand commentedThanks Fly85! Works perfectly.
Comment #12
sahuni commentedThanks for #10.
How would I test for a specific field?
I'd like the cc just for an email field of a specific content type (exemple field_aaa_email) and do not want that cc for contact form or other email fields.