It looks like the "Resend e-mails" feature is non-functional when using the conditional email sending feature (i.e. setting the "to" email address through a "select options" field mapping to email addresses).
The "Resend e-mails" screen shows a greyed out check box with an "empty" message instead of an email address and will not allow to resend the email (see attached images).
Apparently the webform_submission_resend() function isn't mapping the selected option(s) to the correct email and therefore fails any email validation tests. This function was overlooked when implementing the conditional email sending feature.
I will be posting a patch correcting this soon.
Comment | File | Size | Author |
---|---|---|---|
#8 | webform-cannot_resend_emails-2451077-7.patch | 1.66 KB | DanChadwick |
#2 | webform-resend-emails-fixed.png | 18.36 KB | skyhawk669 |
#2 | webform-cannot_resend_emails-2451077-2.patch | 1.13 KB | skyhawk669 |
webform-resend-emails1.png | 16.39 KB | skyhawk669 | |
webform-resend-emails2.png | 17.46 KB | skyhawk669 |
Comments
Comment #1
skyhawk669 CreditAttribution: skyhawk669 commentedAdded images.
Comment #2
skyhawk669 CreditAttribution: skyhawk669 commentedPatch uploaded.
The resend email feature now works again.
Comment #3
skyhawk669 CreditAttribution: skyhawk669 commentedForgot to update status...
Comment #4
DanChadwick CreditAttribution: DanChadwick commentedSeems odd that code was missing, since the feature used to work. I haven't looked at it, but I certainly want to understand what broke it before committing a fix.
Comment #5
skyhawk669 CreditAttribution: skyhawk669 commentedDan,
The resend email feature does work, except when using the conditional email feature: this is when the email address where the submissions are sent is mapped to a select option ("to" email address is different depending on which check box, radio button or select box item is chosen).
You can see the patch that added that feature here: https://www.drupal.org/node/687606 (I was one of the people that contributed to that patch). when this feature was added, the resend function was overlooked and therefore would not pull the correct address. I never noticed that until now.
You can test this by creating a form where you add a select option field and then set an email and choose this component as "E-mail to address". You can now add email addresses for each options.
Submit a submission in this form, then go to the results and click on the "resend emails" and you'll see that the check box is greyed out (like in the image I included in the first post).
The patch just adds a mapping process to the webform_submission_resend() function so that the correct email address is pulled when the "E-mail to address" comes from a select option component instead of a regular email or text component.
Comment #6
DanChadwick CreditAttribution: DanChadwick commentedThanks for the patch. I'll try to get to it in the next day or two. My only thought is if there is code duplication that should end up in a utility function. I'm not saying there is, just that I thought we should look.
Comment #8
DanChadwick CreditAttribution: DanChadwick commentedThanks for the patch and explanation. I made one small change. Rather than using email['email'] as a temporary value, I used an actual temporary. I think this is a little saver for future maintainers. Very minor point.
Committed to 7.x-4.x and 8.x.