Hi everyone,
I made my own confirmation email in html and I'm pretty pleased with the result. Everything from the html code to the php variables are found and being send and received correctly in the email through the modified "webform-mail.tpl.php" file
However, since I'm setting up different forms with each having a different confirmation emails, I modified the original "webform-mail.tpl.php" file accordingly placing the different nodes for each form and renaming the files like this:"webform-mail-[22].tpl.php" and so on.
Now for your info. I'm using a zen subtheme called accendi_prestito, I have the webformblock module installed and I use webform2sugar.
The actual form and form variables that are being send to the customer are in node 22, and the form in node 22 is actually a block (using webform block) I have put into a content page that's node 4.
Taken into account what i just wrote the tpl file for form 22 placed into node 4 should be named "webform-mail-[22].tpl.php", is it not?
Second issue:
Having accendi_prestito as a sub file of the zen theme I have put both the "webform-mail-[22].tpl.php" and the original (unmodified) 'webform-mail.tpl.php' in the \sites\all\themes\zen\zen folder and in the \sites\all\themes\accendi_prestito folder.
In the folder \sites\all\modules\webform I left the original webform-mail.tpl.php without "webform-mail-[22].tpl.php".
As you probably can guess the mail received sending the data placed into the form in node 22 is based on the 'webform-mail.tpl.php' and not on my modified "webform-mail-[22].tpl.php" intended for my form.
Is there a conflict with webform block? Should I name the file intended for node 22 and placed into node 4 as a block in a different way?
Has it to do with the sub zen theme, or -I'm certain it is not- is it something with the sugar to crm module?
I hope I explained myself well, maybe it's an issue someone ran into before, I could not find it in the issues library.
Ciao,
Friso
This is the HTML I used in the webform-mail-[22].tpl.php file.
<?php print t('Roma, @date', array('@date' => format_date(time(), 'small'))) ?>
<style type="text/css">
<!--
.Stile1 {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
.Stile2 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<p class="Stile1">Ciao <?php print $form_values['submitted_tree']['first_name']; ?>,</p>
<p class="Stile1"> <?php print $form_values['submitted_tree']['grazie_preventivo_subject']; ?></p>
<p class="Stile1">I dati che ci hai inviato sono i seguenti:</p>
<table width="400" cellpadding="0" cellspacing="0" bordercolor="ffffff" bgcolor="#FFFFFF">
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td width="184" bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>Nome</strong></td>
<td width="216" bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['first_name']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>Cognome</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['last_name']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>Data di nascita </strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['data_nascita']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>Città</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['primary_address_city']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>Provincia</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['primary_address_state']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>email</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['email_from_address']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>cellulare</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['phone_mobile']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>fax</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['phone_fax']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>telefono fisso </strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['phone_home']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>lavoro</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['description_2']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>stipendio netto mensile </strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['description_3']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>tipo di finanziamento</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['description_4']; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><strong>durata</strong></td>
<td bordercolor="#FFFFFF" bgcolor="ffffff" class="Stile2"><?php print $form_values['submitted_tree']['description_5']; ?></td>
</tr>
</table>
<span class="Stile2"><br>
</span>
<table width="400" cellpadding="0" cellspacing="0" bordercolor="ffffff" bgcolor="#FFFFFF">
<tr bordercolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="Stile2"><div align="center"><strong>Altre informazioni: </strong></div></td>
</tr>
<tr bordercolor="#FFFFFF">
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="Stile2"><?php print $form_values['submitted_tree']['description']; ?></td>
</tr>
</table>
<p class="Stile1">Per qualsiasi domanda o per modificare questi dati Puoi chiamarci al numero <?php print $form_values ['submitted_tree']['nostro_telefono'];?></p>
<p class="Stile1">Un saluto dallo staff di accendiprestito.it! </p>
Comments
Comment #1
tomws commentedPart of your problem may be in the template file name. You have webform-mail-[22].tpl.php. That should rather be webform-mail-22.tpl.php, without the square brackets. I made the same mistake. :(
Comment #2
mwbyrd commentedFriso,
Thanks for opening my eyes on this. I'm not an expert in PHP and am testing a webform using your code (slightly modified for my form) to learn how to do this.
My confirmation email actually has the HTML code it in. Can you tell me what is missing in the code above so that only the webform information is displayed in the confirmaton email.
I have a feeling I'm missing a php statement.
Thanks,
Mike
Comment #3
quicksketchSupport for theming or custom code is not provided in the Webform issue queue.