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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skyhawk669’s picture

Added images.

skyhawk669’s picture

Patch uploaded.

The resend email feature now works again.

skyhawk669’s picture

Status: Active » Needs review

Forgot to update status...

DanChadwick’s picture

Seems 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.

skyhawk669’s picture

Dan,

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.

DanChadwick’s picture

Thanks 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.

  • DanChadwick committed 154deb3 on 7.x-4.x
    Issue #2451077 by skyhawk669: Cannot resend emails for results of...
  • DanChadwick committed 207e23d on 8.x-4.x
    Issue #2451077 by skyhawk669: Cannot resend emails for results of...
DanChadwick’s picture

Status: Needs review » Fixed
FileSize
1.66 KB

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.