Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2010 at 08:56 UTC
Updated:
18 Apr 2014 at 23:14 UTC
Jump to comment: Most recent
Comments
Comment #1
quicksketchI'd suggest you do this in a custom module for all e-mail on your entire site. See the example of hook_mail_alter() I posted in #750690: Form submission EMAIL -> FROM address not taken from email type component (instead, SMTP auth. email is used).
Comment #2
jjchinquistI am continuing to comment here because the other issue is closed.
The suggested solution was to use an implementation of hook_mail_alter. The solution is too general due to the fact that the key for all webform submission emails is "webform_submission". My website requires this "Reply-to" specified differently per webform node.
Reading further into the webform hooks, I came accross hook_webform_submission_render_alter.
I will post if I should find anything, but it looks promising due to the comments. Please give suggestions...
Comment #3
quicksketchAh, sorry I thought you said that "Reply-to" had to be the same across the whole site.
So doesn't this mean that you could set "Reply-to" based on the user's e-mail entered in the Webform, but then set the "From" to by your webmaster account? I'm missing where a second custom e-mail address would be needed.
Regarding the hook being to general, In 3.x at least, all the necessary information about the webform is now included and accessible from any hook_mail_alter() call, so you can tell the difference between individual forms. See #651042: Please add node id and sid to params in drupal_mail.
Lastly, I don't think
hook_webform_submission_render_alter()would do you any good, since you can't modify e-mail headers at that location. You can however theme the e-mail headers in your site's theme, and that can also be done per node. See the THEMING.txt file included with webform or search the issue queue for sending HTML e-mails.Comment #4
jjchinquistAfter more trial and error, I discovered that hook was not the way to go. I can isolate the webform submission becaue it is a parameter in the hook_mail_alter after all.
Now the last hurdle to get over is the fact that the 'Reply-To' does not seem to be valid in the params... can anyone tell me what I am doing wrong?!?
Comment #5
jjchinquistI feel very stupid here because we are already upgraded to 6.x-3.0-beta6. Updating te version for this comment thread.
Maybe this is just a problem then with the translation to German.
I need the headers for this one webform to look like the following
from: kundenservice[at]quax[dot]at
reply-to: [value submitted by user]
to: [value chosen by the user]
The current settings in the Webform Admin API are:
E-Mail-Absenderadresse: Standard
E-Mail-Absendername: Standard
I only see the ability to change the Sender's Address, am I missing something in the API? I do not want the Spam Filter of the person receiving this e-mail from our system to say: "HMMM... this e-mail was sent from IP www.xxx.yyy.zzz, but the sending address is somethirdperson[at]anywhere[dot]com, which does not match with the sending server... I will regard it as SPAM".
Comment #6
jjchinquistBeing sometimes not willing to give up pays off: For anyone out there requiring theming for Reply-To... this solution works on our server ;) Add the following to your template.php
Comment #7
quicksketchGreat, sounds like you figured out a solution through theming.
Comment #13
fietserwinA Drupal 7 version might look like:
notes:
- I don't test on nid (I have several translated versions of a contact form), but directly on the availability of a given field. This works also better for non required e-mail fields.
- empty() won't issue any warning/notice, not if key submission does not exist, nor if it is not an object, nor ...
Comment #14
jamiehollernSo are there any plans to put this into the module?
Comment #15
quicksketchNo.
Comment #16
sbandyopadhyay commentedSince this won't be included in the webform module, I've created an add-on module to do this: Webform Reply To.
Comment #17
jordanmagnuson commentedAny chance of reconsideration on this? I don't really understand why we can't include a reply-to header option in the webform email settings along with the other options? I need to be able to set the reply-to header in order to get emails sent by webform to work properly with the Mandrill module, and it seems silly to have to use an add-on module just to be able to set that one header (when Webform already allows us to set other headers as expected)...
Put another way: I assume there must be a good reason for not allowing people to set the reply-to header from within the webform settings, but I can't figure out what the reason is...?
Comment #18
quicksketchThanks @JordanMagnuson, I think you're right. Things have changed since that issue was closed, so lets revisit it. To keep the noise level down from this old issue, let's continue this in #2236237: Use Reply-To instead of From e-mail headers (Google/Yahoo/etc anti-spoofing policy marks e-mails as spam).