quicksketch,

I have themed the email message sent to the person filling out the webform as well as myself as confirmation. I am adding a little session information to the message but it is being sent to just the person filling out the form. I don't see the same email message as the client. I am clearing the added session data at the end of the theme.

As I see it, one of two things are happening:
1. only the email address in the "Conditional e-mail recipients" is themed.
2. more than one email is sent. Thus my session data is unset().

Can you please confirm how the messages are generated and as to why I am not receiving the same email as the person filling out the webform?

thanks
g

Comments

quicksketch’s picture

All the e-mails are run individually through the webform-mail.tpl.php file, though I'm not sure about which order they are run. So if Webform sends 4 e-mails, the code in webform-mail.tpl.php will be run 4 times. You can ensure that code is only executed certain recipients by checking the $cid variable, which is the Component ID of the field that contains the entered e-mail. For the "main" e-mail address (the one that's not a conditional recipient), the $cid will be 0.

gwlangie’s picture

Thank you. This is what I thought was happening. I will find a way to work around it.

gwlangie’s picture

quicksketch,

I am looking into this and I now have a question. The $form_values array contains the email information that the user completes via the form.

My question is in regards to the section "Web mail Settings" --> "E-mail to address:". This an edit box where you can have a list of email addresses separated by a comma. How can I get to those values?

quicksketch’s picture

Those values will be saved in $node->webform['email'] I believe.

quicksketch’s picture

Status: Active » Closed (fixed)