Hello,
I currently have a v5 form that uses some custom php code in the email template:
This adds part of the the input value ID to the value that was entered in the input box.
I'm in the process of updating and rebuilding this form into ChronoFroms v6, however this code does not seem to translate to the v6 form.
Can anyone help and provide an example of how this should be formatted for a v6 form?
Thanks
Lee
I currently have a v5 form that uses some custom php code in the email template:
<?php if ( !empty($form->data['SSS-HPLB']) ) { echo "{$form->data['SSS-HPLB']} - HPLB"; } ?>
This adds part of the the input value ID to the value that was entered in the input box.
I'm in the process of updating and rebuilding this form into ChronoFroms v6, however this code does not seem to translate to the v6 form.
Can anyone help and provide an example of how this should be formatted for a v6 form?
Thanks
Lee
$form->data is $this->data
Best regards
Best regards
Thanks for the reply, I've now changed my code to:
But when I submit the form, the email does not format and provide the entered value, instead I get:
Which seems to just render the code?
<tr>
<td>Roofing Product Line Brochure</td>
<td><?php if ( !empty($this->data['SSS-HPLB']) ) { echo "{$this->data['SSS-HPLB']} - HPLB"; } ?></td>
<td><?php if ( !empty($this->data['MSS-HPLB']) ) { echo "{$this->data['MSS-HPLB']} - HPLB"; } ?></td>
<td> </td>
</tr>
<tr style="background-color: #D9D9D9">
<td>Polyiso Facer Guide</td>
<td><?php if ( !empty($this->data['SSS-FACER']) ) { echo "{$this->data['SSS-FACER']} - FACER"; } ?></td>
<td><?php if ( !empty($this->data['MSS-FACER']) ) { echo "{$this->data['MSS-FACER']} - FACER"; } ?></td>
<td> </td>
</tr>
But when I submit the form, the email does not format and provide the entered value, instead I get:

Which seems to just render the code?
Yes, the email body will NOT run PHP code, you shoukd place this code in a "Custom code" action before the email, set the "Return as var" to enabled, then use {var"custom_code_name} in the email body!
Best regards
Best regards
Hi,
Thanks for the explanation, I'm still not 100% certain what to do?
Would it be possible for you to provide an example of the code I need to add into the custom code action?
Thanks for the help and advice.
Lee
Thanks for the explanation, I'm still not 100% certain what to do?
Would it be possible for you to provide an example of the code I need to add into the custom code action?
Thanks for the help and advice.
Lee
Put the code you have in a "Custom code" action, make it ABOVE the email, enable the "return as var", then use {var:custom_code_name} in the email body!
This topic is locked and no more replies can be posted.