I'm a relative newcomer to Drupal and PHP, and I have put together a Drupal site for a small high school, where we wish to use webforms to allow teachers to contact other teachers regarding specific students. So far, webform module seems very promising for this, however it would be very handy if it were possible to optionally CC additional support staff from the webform.
Any thoughts on how to accomplish this? I tried tinkering with adding a cc address variable and form field to the webform module, and modified the user_email function (in user.module) to accept a cc address variable, but I don't know how to get the mailserver to understand how to handle a cc. How can the user_email function be re-written to enable optional cc-ing without messing up the other cases where user_email is used for site administration or user contact?
Comments
You should add you CC to the
You should add you CC to the header of the mail. It must not contain line breaks.
CC: somebody@drupal.org, somebody@gmail.com, .....
CC(Carbon Copy) can also be seen by each of the recipients. If you don't want this to happen, then use BCC(Blind Carbon Copy).
I am not using webform or user_email modules so I have no specific things to say for these modules.
--------------------------------------------------------------
http://www.students.itu.edu.tr/~koseer/drupal/ - works on PHP-TXT-DB database layer.
Got it to work!
Thanks for the tip. I got CC to work by doing the following
1) Added field email_cc to the webform database using phpmyAdmin
2) Changed this section
3) And this section
4) And this section
5) And this section
Note the above is for a limited list of "select" style options, and CANNOT be used with multiple select. All select options must be email addresses separated by commas. An alternative option, that would leave you more vulnerable to spam, would use a textfield.
6) And this section:
Note, commenting out the above leaves one vulnerable if webforms are used by anonymous users. For me this isn't an issue, as they are only used internally.
7) Make a webform and set up a CC select field that contains the email addresses you want your users to select from.
To do: Ideally, I wanted to allow checkboxes, with the ability for multiple CC selections. This doesn't work given the way this module returns multiple choice information. Instead of a comma-separated string, the module returns a table of selected values like this:
0 = choice 1
1 = choice 2
2 = choice 3
etc.
Perhaps someone knows how to alter this?
Bug in step 2 above
Change to
Note: added a fifth '%s' to the VALUES argument.
Webform CC
Webform CC adds the option to CC email addresses on the emails sent out by the Webform module. A D7 version is forthcoming.
(Username formerly my full name, Richard Eriksson.)