Gday GreaHead,
Thank you for your help.
From your reply I decided to add the script to the 'emails' as I was using it in the 'Thank you message'.
The code works for the emails, but not for the 'Thank you message'.
You can see the error on the attached image 'thankyou.jpg'.
The following is the code for the thank you message complete.
<div class="container" style="margin: 20px; 0 80px 0;">
<h2>Thank you for your question</h2>
<br />
<div class='cTitle'>
<h4>Hello
<?php
if ($form->data['PreferedName'] != "") {
echo $form->data['PreferedName'];
} else {
echo $form->data['FirstName'];
}
?>
,</h4>
</div>
<br />
The following is the debug info.
Data ArrayArray
(
[option] => com_chronoforms5
[chronoform] => Ask_a_question-php
[event] => submit
[FirstName] => fred
[PreferedName] => fredthemagnificent
[Email] => fred@nowhere.com
[ContactNumber] => 5555555
[Questions] => Why is the sky blue
[captcha] => 2Wj4z
[ApplyNow] => Submit
[ip_address] => xxx.xxx.xxx.xxx
)
Array
(
)
Errors Array
(
)
Debug InfoArray
(
[0] => Array
(
[Email] => Array
(
[0] => An email with the details below was sent successfully:
[1] => To:xxx@xxx.xxx
[2] => Subject:Logisafe: Question from fred
[3] => From name:fred
[4] => From email:xxx@xxx.xxx
[5] => CC:
[6] => BCC:
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
[10] => Array
(
)
[11] => Body:
<div class='sfm_table_container'>
<h2>Ask a Question</h2>
<p>You have received a question from
fredthemagnificent,</p>
<p>They are expecting that you will contact them shortly, usually within one business day.</p>
<table cellSpacing='0' cellPadding='5'>
<tr><td class='FieldName'>PreferredName</td><td class='FieldValue'></td></tr>
<tr><td class='FieldName'>Unit Code</td><td class='FieldValue'></td></tr>
<tr><td class='FieldName'>First Name</td><td class='FieldValue'>fred</td></tr>
<tr><td class='FieldName'>Email</td><td class='FieldValue'>fred@nowhere.com</td></tr>
<tr><td class='FieldName'>Contact Number</td><td class='FieldValue'>5555555</td></tr>
<tr><td class='FieldName'>Question Asked</td><td class='FieldValue'>Why is the sky blue</td></tr>
</table>
</div><br /><br />IP: 27.96.216.79
)
)
[1] => Array
(
[Email] => Array
(
[0] => An email with the details below was sent successfully:
[1] => To:fred@nowhere.com, {email}
[2] => Subject:Logisafe: Your Question
[3] => From name:Logisafe
[4] => From email:training@logisafe.com.au
[5] => CC:
[6] => BCC:
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
[10] => Array
(
)
[11] => Body:
<div class='sfm_table_container'>
<table>
<tr><td class='FieldName'>Course Name</td><td class='FieldValue'></td></tr>
<tr><td class='FieldName'>PreferedName</td><td class='FieldValue'></td></tr>
<tr><td class='FieldName'>Unit Code</td><td class='FieldValue'></td></tr>
<tr><td>Hi</td><td>fred</td></tr>
<tr><td>Your question</td><td>Why is the sky blue</td></tr>
</table>
</div>
<br /><br />IP:xxx.xxx.xxx.xxx
)
)
)
I can not see anything useful in the debug ino.
Thank you again for your time.