I am trying to get a webform to send emails to different addresses depending on the value of a SELECT dropdown, as documented in webform.

However, webform_confirm_email_mail_alter() is clobbering this by changing the recipient address to a '+':

$message['to'] = '+'; // prevents drupal_mail from actually sending the message

I tried debugging this a bit but I can't follow what the code of this module is trying to do.

Comments

mattferris’s picture

This may be related to #1076128: Conditional emails being sent too early.

From my understanding, all the configured emails for a form are sent upon submission of said form, including all conditional emails. This module intercepts those conditional emails and basically addresses them to '+' which effectively prevents them from being delivered. Once an email is confirmed, the module manually sends the conditional email.

Are you receiving able to send out any emails through your form?

As well, if you created your form emails before you installed the module, you'll have to delete the emails and recreate them or you won't be able to save the 'Always', 'Confirmation', 'Conditional' setting on the email.

matthias_mo’s picture

Status: Active » Closed (fixed)

please get the latest git version that should fix the problem.

matthias_mo’s picture

please get the latest git version that should fix the problem.