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.
Each recipient of a webform submission is sent an individual email. For contact forms where multiple folks are collectively responsible for ensuring the submitter is responded to [only once], having a single thread -- where Reply-all can be used -- is extremely helpful.
I believe this is how Webform used to work, including all recipients in the To: field of a single message...
Can we add an option to the "E-mail to address" to send individually or together? I will write the patch if the functionality [does not exist and] is welcome.
Comments
Comment #1
quicksketchI'm not sure adding this as an option is a good idea, but it's not the first time it's been requested.
Comment #2
acombites CreditAttribution: acombites commentedYes indeed, Webform did used to work this way prior to 6.x-3.9, and my organization relied heavily on the "reply to all" capability. So I don't view this so much as a requested feature as a "please go back to the way it used to work."
Comment #3
hot_sauce CreditAttribution: hot_sauce commentedI too am in need of this, though my issue is for the 6x version of Webform, which i posted in a (now duplicate) issue - http://drupal.org/node/1168442
I think a patch for this would be most welcome by myself and inevitably others who discover that the functionality is no longer there.
Comment #4
kari.kaariainen CreditAttribution: kari.kaariainen commentedI'm dreaming of functionality that would allow me to just hit reply, type my customer service answer and fire away, sending bcc copies to my fellow support team members automatically and showing a nice and clean reply to the original sender etc.
While that may be utopistic, a token containing all the recipients would be of great help.
I'm doing that now manually using the template, like so:
"...This message was send to (copy these, excluding yourself, to the bcc field):
customer.help1@site.com, customer.help2@site.com, customer.help3@site.com..."
With a token I could do:
"...This message was send to (copy these, excluding yourself, to the bcc field):
%all_recipients..."
Comment #5
jadowd CreditAttribution: jadowd commentedokay... so what is the status of this... there is a need to have a group email sent out based on the selected option... but this is broken. How soon can this be fixed?
Comment #6
mefisto75 CreditAttribution: mefisto75 commentedsub
Comment #7
jadowd CreditAttribution: jadowd commentedHey... can we get a hook or something in there that allows people to change how this works? this is BROKEN!
Either there needs to be an option to permit all recipients to see the email, or it just needs to be set up to work that way. There are a lot of folks here that need this to support the old method, and for good reason. Can we get some dialog about this?
Comment #8
quicksketchYes, please continue the dialog. Constructive feedback about exactly how this should be added to the interface (if we add it as an option) or research that counters my privacy/spam-prevention assumptions (people don't want their e-mail shared, bulk e-mails are more likely to be flagged as spam) would help move this along. Patches are also a good thing, but right now I'm more concerned with the theoretical changes than the code.
Comment #9
jadowd CreditAttribution: jadowd commentedI agree... my client is going bonkers about this... their system is pretty broken :(
Comment #10
MichelleI think adding it as an option is a good thing. If the site builder has the choice, then Webform doesn't need to concern itself with privacy / spam issues. The site builder can decide if the benefit is worth the risk. In my case, with a small club site and multiple board members needing to be in on the conversation, I would definitely use this feature.
Michelle
Comment #11
jeffschulerTheoretical implementation:
The "E-mail to address(es)" field could be dynamically expanding: click "+" to add another recipient. This would add a new form field, (actually, a new set of "Custom | Component" radios & their respective fields.)
Each address in a single instance of this field would receive its own, individual email.
All comma-separated addresses placed in a single field would receive a single multi-recipient email and see eachother as recipients.
Comment #12
nairb CreditAttribution: nairb commentedThe comma separated approach works fine and is simple enough. You could have 3 separate "Email to addresses" on the Email Settings screen. One each for "to", "cc", and "bcc". A hook and sub module would be fine if you want to keep the code separate.
While I handle most of the incoming webform mail, I have several forms that I should only be cc'd on, or should be sent to a department head and cc a couple supervisors. This way, there is no confusion who the intended recipient is and the other people see who else has received the message and can respond if appropriate. Currently, each person receives their own copy of the message and is not aware of the message being sent to other people (unless they were told in person, or add it to the message as kari suggests). This aspect of the system is not very user friendly. Shouldn't the site admin be the one to decide how messages are sent?
The spam issue is a tricky one. When do you see bulk email and privacy being a problem? If you have explained it before a link would be helpful. :)
Brian
Comment #13
acombites CreditAttribution: acombites commentedI'm changing this to a bug report. Webform used to work this way, and at some point it was changed, and this functionality was broken.
Comment #14
quicksketchIt was changed intentionally and for privacy reasons. I realize that privacy may not be a concern for all users of Webform, but it's intentional that privacy is enforced by default. Restoring this as a feature isn't the same as it being a bug.
Comment #15
windmaomao CreditAttribution: windmaomao commenteddoesn't really matter why people need it to be added. Security isn't an issue if we haven't gotten anything for outsider to steal.
here's some quick fix solution.
Solution 1) at line 162 of _webform_validate_email in email.inc, disable the validation check as a start
Solution 2) split lines using explode, and check each address with current validation method
Solution 3) to go further, add an option checkbox "Multiple emails" under validation in email field form.
I'm going to test the above solutions.
Comment #16
Shawn DeArmond CreditAttribution: Shawn DeArmond commentedThis should stay on 7.x-3.x-dev as it's a yet-to-be committed feature request.
Comment #17
acombites CreditAttribution: acombites commentedThere are other ways to address privacy concerns. And privacy has always been addressed be default - as it should be. But there used to be a mechanism for developers to adapt the communication method to fit our needs. And now that flexibility has been removed.
Comment #18
jadowd CreditAttribution: jadowd commentedMake this a configuration option, and be done with it.
Comment #19
vernond CreditAttribution: vernond commentedHmmm, seems to be quite a bit of emotion bubbling under this issue and I don't really understand why that should be.
As I understand @quicksketch, this functionality is not available by design because it creates a scenario for potential abuse - either knowingly or, more importantly, unknowingly. I happen to agree (and for the same reasons that I agree that Webform should not have a credit card number component and that the canning of Webform PHP is a good thing - features that can be abused will be abused).
The lack of user interface configuration options in this regard is not at all an insurmountable obstacle though. Take a look at this excerpt from Webform's THEMING.txt (emphasis added):
There is far more flexibility inherent in adding a few lines of conditional code to the template file than what can easily be coded into Webform's UI e.g.:
IMHO, uploading changes to template.php is probably not too much to ask of someone responsible for maintaining a Drupal website and it seems unlikely that template.php will require updating on a daily/weekly basis anyways. I guess that's my tuppence on the matter.
Comment #20
PizzaMan CreditAttribution: PizzaMan commentedFollowing.
The integration of the feature is crucial to the module. Way too many client requests have come in for this. The inclusion of this functionality should be kept extremely simple though.
Set a Boolean value (checkbox) that toggles between either sending a single email to all targeted recipients, and default to a unique message to each recipient when not checked.
Maybe I am being obtuse, but I think the privacy concern is being handled a bit too delicately. All instances so far where I received requests for this implementation involves members of a sole organization being included on the same message. There are not very many scenarios I can think of where the user submitting the form should be included on an email with anyone else.
Maybe this is something that is restricted by domain? The only time this functionality will work is when all recipients share the same @domain.com.
Comment #21
quicksketchThis sounds good to me. Preferably we'd only show this checkbox if a comma is in the address field.
Comment #22
quicksketchMaybe radio buttons make sense here to clarify the difference between a single e-mail and individual ones:
Comment #23
quicksketchThough new features are only being added to 4.x at this point, so up another version it goes.
Comment #24
pierrelebear CreditAttribution: pierrelebear commentedI was asked for this by a client who wants to have the same email sent to multiple people in the organization. This is so one person can respond to the customer and the internal group with a "reply to all". It would be a very useful feature.
I would suggest that when the email field has multiple emails separated by commas, one email is generated. When each recipient is one line item, individual emails are sent.
Thanks for a wonderful module!!!! Generally it works great!
Pierre
www.ventimar.com
Comment #25
N1029676 CreditAttribution: N1029676 commentedThere really doesn't need to be anything changed from when this worked before.
If I use commas in a single entry box, that implies I want this message to go to all of those people in one message.
Different entries into that list should be treated as such.
Comment #26
Shawn DeArmond CreditAttribution: Shawn DeArmond commented@pierrelebear: See #23.
Just to engage the discussion here, I'm just interested in seeing CC and BCC fields.
Comment #27
PizzaMan CreditAttribution: PizzaMan commentedJust checking in on this thread to see if anything was implemented?
I came up with a workaround a while back which utilized a setting session cookie to determine who all was to receive a single message with all recipients included, and set the value of that cookie in the mail headers via the THEME_webform_mail_headers function.
Since we had multiple groups of people depending on the category selected on the form we had to go nuts on making that send functionality happen.
And of course one month after implementation the client came back and asked that we set the form to send to a single recipient. SMH, lol...
Anyway, if anyone else is interested in the workaround, let me know and I will post it!
Comment #28
JoshEpic CreditAttribution: JoshEpic commented@PizzaMan
Could you post the work around?
Comment #29
erykolryko CreditAttribution: erykolryko commentedpizaman Kindly share the cookie and guide where to alter the code, so stuck my client is on my neck on that issue need to send the emails to many recepients (webform4x drupal 7).
Comment #30
PizzaMan CreditAttribution: PizzaMan commentedIn order to make sure we were sending a single message to multiple recipients we leverage a mixture of php and javascript in a couple of places.
Here is what we will be altering:
webform-form.tpl.php
template.php
We will also be creating a php file used in setting our session variable. In our working model we've named it:
__session.php
First, let's start with our webform tpl file:
In our case we had multiple groups of form recipients depending on the nature of the submission. Within each group, we had many of the same email recipients. At first we thought to set the emails to receive each type of message within each field value of the form itself. However, this triggered a bug because some recipients were the same across different categories, and required adding extra whitespace to each identical field value. Kind of annoying. Instead we set the email values with Javascript!
Because we only have one form on the site, to keep things quick an easy we add the following script to our webform-form.tpl.php file:
Let's have a look at our __session.php script now that we've established where our email addresses are being set. The trick here is that we need to access our Drupal installation from a standalone script in order to set our selected email values from webform-form.tpl to a session variable. We accomplish this using drupal_bootstrap().
In your __session.php file use the following code:
We now have our email recipients defined and a means for Drupal to access that data. All that is left to do is tie everything together in our template file.
First thing we want to do here is make sure our form is correctly setting email values from our select field. We need to make sure our javascript function that we defined in the webform-form.tpl is being fired. Here we are going to be utilizing the THEME_preprocess_webform_form function:
Finally, now that we know we are setting our target email addresses properly within the session variable we can use its value when altering email headers when the message is being sent. We do this using the THEME_webform_mail_headers function in our template file as well.
In template.php use the following code:
And there you have it! Let me know how it works out for you, or if you come up with a more simplified approach for your case.
Comment #31
erykolryko CreditAttribution: erykolryko commentedHi Pizzaman
First, many thanks for your effort in helping solve this.
Iv tried it many time i really do not know what i'm getting wrong
1. copied the first bit in to webform-form.tpl.php section between {
..
PASTED HERE..
} , removed this word "[path to your session script]" maintained /__session.php (in root).2.Created __session.php, pasted, made sure file permission are okay.
3. copied 3rd bit removing the php tags in to template.php
4. copied 4th bit removing php tags in to template.php below [3] function above. (replaced word "THEME" to my theme "mayo")
5. option 1-created a drop down with field name customer_service, public_relations, sales_gen, etc
option 2-created a text field with field name & form Key "customer_service"
6. Went to webform-form.tpl.php added a string of emails replacing "email@email.com"
7. In the Webform=>Email section at header. I chose component=>customer_service after testing n failing i choose component=>department (contains customer_service).
8. performance cleared cache.
9.STILL NOT SENDING EMAILS to what what i entered in webform-form.tpl.php so i can see all the recipients at a go
What im i doing wrong ?? NB {webform 7.x-4.0-alpha4, webform builder, SMTP/HTML mail}
Anybody succeeded?
Comment #32
PizzaMan CreditAttribution: PizzaMan commentedDo you have your webform configured to send an email upon submission?
I failed to mention that we should have our target webform set up to send an email upon submission. In our case we used a catchall address for the company domain. If I am not mistaken, the email addresses are appended to the header so that they will be displayed alongside the catchall address.
Let me know if this yields any positive results.
Comment #33
erykolryko CreditAttribution: erykolryko commentedHi Pizzaman
Yes my webform submits HTML email upon submission i use (HTML mail and SMTP). Funny enough even after making all those changes above it still submits emails as before. (to each user alone and does not show the other recipients)
All email settings are on the email section of the webform.
Also, after going through my procedure above did you detect anything wrong?
So far for me no progress, when i email each email is sent to users and does not show the other recipients.
Attempted Work Around:
I have installed "Webform reply to" module, it lists the person who i can reply the email to on the email header, unfortunately still i cant add more than one email to the list. If this works it will sort alot. Apparently the developers on the other site aint replying also.
Ooops
Comment #34
erykolryko CreditAttribution: erykolryko commentedTried many solutions until i came across this link http://drupalcode.org/sandbox/jitesh_doshi/1811566.git i downloaded the (wfdemo.info, wfdemo.module, jquery.multiselect.css, wfdemo.js ) put them in a folder called Webform demo
Installed the module NB(You have to disable Webform builder to access the BCC functionality)
It will add a BCC field (Webform 4x drupal 7) for multiple emails for the Outlook & thunderbird still testing for gmail
Comment #35
beardedgeek CreditAttribution: beardedgeek commentedIs there an update on the re-implementation of this feature?
Being able to "reply to all" within our company is a complete must.
Comment #36
beardedgeek CreditAttribution: beardedgeek commentedAnything?
Comment #37
swim CreditAttribution: swim commentedThis solution follows a very similar concept & will overflow to multiple recipients as well, https://drupal.org/comment/6788938#comment-6788938
webform_submission_send_mail is the ticket.
Please correct me if I'm wrong but I think quicksketch doesn't want this implemented into Webform due to the fact that there are a number of ways to already achieve this functionality. Aside from the fact it's at best a fringe use case.
Cheers,
Comment #38
quicksketchI've rethought my position since #22, in which I thought a per-form setting would be required. At this point, I think we should make sending a single e-mail to all recipients the default. However, there are 300K sites out there using the current functionality, I don't think we can switch this out from under them.
So instead, I'd like to make a site-wide setting identical to what I described in #22, but make the single e-mail option the default. For users upgrading, we'd provide an update hook to set the option to the current behavior of individual e-mails per recipient.
The big hold up here is (and has been) that just no one has written the code yet. Rather than swapping hacks and work-arounds, it'd be much more helpful if someone could submit a patch to provide this functionality directly in the module.
Comment #39
quicksketchAs with all new features, this is only going to be added to the 4.x version.
Comment #40
cwightrun CreditAttribution: cwightrun commentedHas this feature been implemented into the 4.x-dev version?
Comment #41
webservices@tulane.edu CreditAttribution: webservices@tulane.edu commentedI've upgraded to version 7.x-4.1. Has this been implemented?
Comment #42
DanChadwick CreditAttribution: DanChadwick commentedA patch along the lines of #38 would be welcome. quicksketch has thought this through, and I accept his design.
To answer the question, no, this has not been implemented as of 7.x-4.1
Comment #43
DanChadwick CreditAttribution: DanChadwick commentedOnce again, I took pity on a 4 year old feature request.
Implemented as proposed in #22 and #38. The default for existing installation will continue to be individual. New sites will send one message to all recipients. An update is required.
Committed to 7.x-4.x.
Comment #44
DanChadwick CreditAttribution: DanChadwick commentedComment #46
DanChadwick CreditAttribution: DanChadwick commentedOooh. Forgot to delete the new variable upon uninstall. Not applicable to D8.
Committed to 7.x-4.x.
Comment #48
fenstratCommitted and pushed to 8.x-4.x. Thanks!
Comment #51
Viktor-T CreditAttribution: Viktor-T at Ixis - UK Drupal Support, Maintenance, Hosting and Development commentedThe Same patch adapted for Webform 7.x-3.26.
Comment #52
Viktor-T CreditAttribution: Viktor-T at Ixis - UK Drupal Support, Maintenance, Hosting and Development commentedfixing patch for 3.29