When you try to resend the email of a submission, and check an email address that is disabled for sending in the general email settings of the webform, and there is no other address to which an email is succesfully sent, you get the error message "No e-mails were able to be sent due to a server error." This is very confusing, as there was no server error.

From comment:

After looking at the code, it seems there may be something not working properly.

webform.submissions.inc

function webform_submission_resend_submit()
  ...
  $sent_count = webform_submission_send_mail($node, $submission, $emails, TRUE);

The TRUE in the code above is for the parameter $send_disabled. This parameter is supposed to ensure emails are sent, even if disabled. This obviously isn't working here if we are seeing the error message about no emails being sent.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JoshaHubbers created an issue. See original summary.

JoshaHubbers’s picture

This patch only shows email addresses that have the "sending" option enabled. Else the default message "Sending is not enabled for this form" is displayed.

JoshaHubbers’s picture

Status: Active » Needs review
JoshaHubbers’s picture

FileSize
1.46 KB

Oops, fixed indenting.

Liam Morland’s picture

Status: Needs review » Needs work

Please check your coding standards. No need to remove the type declaration.

solideogloria’s picture

In my opinion, it'd be better to send the emails to the selected recipients, regardless of whether the emails are disabled. This is because the enabled/disabled values were shown to the user as the defaults already when they opened the resend emails window, and the user explicitly selected to send to those recipients.

Liam Morland’s picture

Yes, if someone specifically requests that an email be sent, it should be set regardless of the setting. This issue is about the error message so we need to be sure any solution has good messages.

solideogloria’s picture

Title: Confusing error message 'No e-mails were able to be sent due to a server error.' » Disabled emails not sent when selected on 'resend' form.
Issue summary: View changes

After looking at the code, it seems there may be something not working properly.

webform.submissions.inc

function webform_submission_resend_submit()
  ...
  $sent_count = webform_submission_send_mail($node, $submission, $emails, TRUE);

The TRUE in the code above is for the parameter $send_disabled. This parameter is supposed to ensure emails are sent, even if disabled. This obviously isn't working here if we are seeing the error message about no emails being sent.

solideogloria’s picture

Issue summary: View changes
solideogloria’s picture

Issue summary: View changes
solideogloria’s picture

solideogloria’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2893192: Webform not resending email previously unselected

This is already fixed in the latest version of the module. Make sure you are using the latest version.

Fixed here: #2893192: Webform not resending email previously unselected