Buy Now
Sign in

Dynamic email values

ltempest , February 08 at 11:53
L
ltempest
Hello,
I have an email sent from my website when a user completes the form. It dynamically fills in the values in a table format:
<td>{SSS-HD-CG}</td>
If there was nothing entered then this would render empty. However the client now wants additional information to display should this value be required and wish to have:
<td>{SSS-HD-CG} - SOME EXTRA TEXT</td>
I have modified the email template but now when the email is sent it displays the extra text even if there is no value.​
​​
​Can I use some PHP code or similar to check if {SSS-HD-CG} has a value and if so then render the extra text, if it is empty then do not render anything?
Thanks
Lee
GreyHead
Hi Lee,
You can either use PHP in the Email template - or IMHO better use a Custom Code action before the Email action to build the text that you want to display. Please see this FAQ for an example using the Email subject - the same method will work with the body in CFv5.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
ltempest
Bob thanks for the reply. This form is immense! Check out:
https://www.hunterpanels.com/sample-literature
each field is separate! So following the FAQ I guess I would need to do:
<td><?php $form->data['SSS-HD-CG'] = "Some text {$form->data['SSS-HD-CG']} some more text"; ?>{SSS-HD-CG}</td>
And repeat this for every field on the email form.
Is this correct?
GreyHead
Hi Lee,
Try something like this:
<?php if ( !empty($form->data['SSS-HPLB']) ) { echo "$form->data['SSS-HPLB'] - HPLB"; } ?>
But if the extra text is different in each case then it's probably simpler to use a custom code action. include an array of the extra text elements and loop through all the data.
<?php​
​$text_array = array(​
​ 'SSS-HD-CG' => 'SOME EXTRA TEXT',​
​ . . .​
​);​
​foreach ($text_array as $k = $v ) {​
​ if ( !empty( $form->data[$k] ) ) {​
​ $form->data[$k] .= ' - '.$v;​
​}​
​?>
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
ltempest
Bob,
Thanks for the code, I've tried the first solution (i'm not skilled enough to do the array!) on one field but when I try and submit the form I get an error:
Mailer Error: Message body empty
Do I need to do something like parse the form first?
GreyHead
Hi ltempest,
Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
ltempest
Bob,
At the moment I only have the first dynamic field set like so:
<td><?php if ( !empty($form->data['SSS-HPLB'] ) { echo "$form->data['SSS-HPLB'] - HPLB" } ?></td>
When I fill in the form and submit, this is what was displayed on the page:
[ul]
  • Mailer Error: Message body empty
  • [/ul]

    Thank you for your order.

    Orders received after 2 PM EST will be fulfilled the next business day.

    Data Array
    Array
    (
    [chronoform] => SamplesLiteratureRequest
    [event] => submit
    [firstname] => Lee
    [lastname] => Tempest
    [companyname] => TESTING
    [address] => TESTING
    [address2] => TESTING
    [addresscity] => TESTING
    [addressstate] => AS
    [addresszip] => TESTING
    [phonenumber] => 01452312581
    [recipientemailaddress] => lee@stormcreativedesign.co.uk
    [orderedbyemailladdress] => lee@stormcreativedesign.co.uk
    [occupation] => Other
    [comments] => testing
    [addresstype] => Business
    [deliverytype] => UPS Ground
    [SSS-HPLB] =>
    [MSS-HPLB] => 5
    [SSS-FACER] =>
    [MSS-FACER] => 7
    [MSS-022] =>
    [SSS-HS-FLC] =>
    [MSS-HS-FLC] =>
    [SSS-HS] => 2
    [MSS-HS] =>
    [SPL-HS] => 2
    [SSS-HS-F] =>
    [MSS-HS-F] => 7
    [SPL-HS-F] =>
    [SSS-HS-CG] =>
    [MSS-HS-CG] =>
    [SPL-HS-CG] =>
    [SSS-HS-P] =>
    [MSS-HS-P] =>
    [SPL-HS-P] =>
    [SSS-HS-WF] => 8
    [MSS-HS-WF] =>
    [SPL-HS-WF] =>
    [SSS-HS-HD] =>
    [MSS-HS-HD] =>
    [SPL-HS-HD] => 9
    [SSS-HD-ADV] =>
    [MSS-HD-ADV] => 10
    [SSS-HS-HDC] =>
    [MSS-HS-HDC] =>
    [SPL-HS-HDC] =>
    [SSS-HDC-ADV] => 2
    [MSS-HDC-ADV] =>
    [SSS-HS-SCBC] =>
    [MSS-HS-SCBC] => 6
    [SPL-HS-BC] =>
    [SSS-THS] =>
    [MSS-THS] =>
    [SPL-THS] => 9
    [SSS-THS-CG] => 4
    [MSS-THS-CG] =>
    [SPL-THS-CG] =>
    [SPL-HTS] => 6
    [SPL-TS] => 6
    [SSS-SUMP-ADV] =>
    [MSS-SUMP-ADV] => 3
    [SSS-TEPS] => 4
    [MSS-TEPS] =>
    [SSS-TDA] =>
    [MSS-TDA] => 5
    [SSS-TAPBRO] => 6
    [MSS-TAPBRO] =>
    [SSS-PRECUT-ADV] =>
    [MSS-PRECUT-ADV] => 8
    [SSS-HS-TLC] => 9
    [MSS-HS-TLC] =>
    [SSS-COOL] =>
    [MSS-COOL] => 10
    [SPL-COOL] =>
    [SSS-COOL-IG] => 1
    [SSS-COOL-SHNGLE] => 2
    [MSS-COOL-SHNGLE] =>
    [SSS-HS-NB] =>
    [MSS-HS-NB] => 4
    [SPL-HS-NB] =>
    [SSS-NB-IG] => 7
    [SSS-HBINDER] => 9
    [SPL-FI] => 6
    [SPL-FI-WD] => 4
    [SSS-XCI-BRO] => 3
    [MSS-XCI-BRO] =>
    [SSS-XPL] =>
    [MSS-XPL] => 2
    [SSS-XCI-F] => 1
    [MSS-XCI-F] =>
    [SPL-XCI-F] => 1
    [SSS-XCI-CG] =>
    [MSS-XCI-CG] => 5
    [SPL-XCI-CG] =>
    [SSS-XCI-CG-CA] => 7
    [MSS-XCI-CG-CA] =>
    [SPL-XCI-CG-CA] => 9
    [SSS-XCI-CAF] => 6
    [MSS-XCI-CAF] =>
    [SPL-XCI-CAF] =>
    [SSS-XCI-286] =>
    [MSS-XCI-286] => 8
    [SPL-XCI-286] =>
    [SSS-XCI-286-ADV] =>
    [MSS-XCI-286-ADV] => 4
    [SSS-XCI-PLY] => 2
    [MSS-XCI-PLY] =>
    [SPL-XCI-PLY] =>
    [SSS-XCI-PLY-CA] => 9
    [MSS-XCI-PLY-CA] => 9
    [SPL-XCI-PLY-CA] => 9
    [SSS-XCI-NB] => 3
    [MSS-XCI-NB] =>
    [SPL-XCI-NB] =>
    [SSS-XCI-NBPLY] =>
    [MSS-XCI-NBPLY] => 6
    [SSS-XCI-CONCAST] => 1
    [MSS-XCI-CONCAST] =>
    [SPL-XCI-CONCAST] =>
    [g-recaptcha-response] => 03AA7ASh3IPnrgIs8vWimLPf--EuQEiJWC9YqPDLNI6nPrp3K00sayFLU5MVSODxZJKnrRFLvEP1awELLPctNtBRH-VReQU6n9ZfTe25t3FQtxUteHFsztA4F4NqQ3TBvbvGa9J4_HzD4o9xLgA1rAIzHAHuUEjVg-sAuUHLg1tp1px2ZT37iLoEVgF0MEQNgNzLkZD4oovZWZJe20RdXYHFpJT2wrdXUxoT2qXIHGsBuIQMbMhzotErIfRDrNdIZWW-BEGheB21wsI6s1N8bIpsBTz9xWpHPoDh2M8ORDvMsQS5fQXV_UmY43KYhhPMHZuSiIHSASt4JlfXZVL-M9sR7z9CF3JOCmyf5pnQhXvZ7G5Nk-8Ytzw4Vh6xay_DsjWvRGUCSQrcVeCgSlujpWHg5nJ3P8YAWanlZSQIAhD-06mRokmaYJsgOuToCM_KL8nx3nE6DmIAgT1u6POsbCKiExgx4_qWP0Bg
    [button132] => Submit
    [id] => 802
    [ip_address] => 80.192.27.244
    )
    Array
    (
    )
    Errors
    Array
    (
    )
    Debug Info
    Array
    (
    [9] => Array
    (
    [DB Save] => Array
    (
    [Queries] => Array
    (
    [0] => INSERT INTO `jc910bt_chronoengine_chronoforms_datatable_SamplesLitRequest` (`firstname`, `lastname`, `companyname`, `address`, `address2`, `addresscity`, `addressstate`, `addresszip`, `phonenumber`, `recipientemailaddress`, `orderedbyemailladdress`, `occupation`, `comments`, `addresstype`, `deliverytype`, `SSS-HPLB`, `MSS-HPLB`, `SSS-FACER`, `MSS-FACER`, `MSS-022`, `SSS-HS-FLC`, `MSS-HS-FLC`, `SSS-HS`, `MSS-HS`, `SPL-HS`, `SSS-HS-F`, `MSS-HS-F`, `SPL-HS-F`, `SSS-HS-CG`, `MSS-HS-CG`, `SPL-HS-CG`, `SSS-HS-P`, `MSS-HS-P`, `SPL-HS-P`, `SSS-HS-WF`, `MSS-HS-WF`, `SPL-HS-WF`, `SSS-HS-HD`, `MSS-HS-HD`, `SPL-HS-HD`, `SSS-HD-ADV`, `MSS-HD-ADV`, `SSS-HS-HDC`, `MSS-HS-HDC`, `SPL-HS-HDC`, `SSS-HDC-ADV`, `MSS-HDC-ADV`, `SSS-HS-SCBC`, `MSS-HS-SCBC`, `SPL-HS-BC`, `SSS-THS`, `MSS-THS`, `SPL-THS`, `SSS-THS-CG`, `MSS-THS-CG`, `SPL-THS-CG`, `SPL-HTS`, `SPL-TS`, `SSS-SUMP-ADV`, `MSS-SUMP-ADV`, `SSS-TEPS`, `MSS-TEPS`, `SSS-TDA`, `MSS-TDA`, `SSS-TAPBRO`, `MSS-TAPBRO`, `SSS-PRECUT-ADV`, `MSS-PRECUT-ADV`, `SSS-HS-TLC`, `MSS-HS-TLC`, `SSS-COOL`, `MSS-COOL`, `SPL-COOL`, `SSS-COOL-IG`, `SSS-COOL-SHNGLE`, `MSS-COOL-SHNGLE`, `SSS-HS-NB`, `MSS-HS-NB`, `SPL-HS-NB`, `SSS-NB-IG`, `SSS-HBINDER`, `SPL-FI`, `SPL-FI-WD`, `SSS-XCI-BRO`, `MSS-XCI-BRO`, `SSS-XPL`, `MSS-XPL`, `SSS-XCI-F`, `MSS-XCI-F`, `SPL-XCI-F`, `SSS-XCI-CG`, `MSS-XCI-CG`, `SPL-XCI-CG`, `SSS-XCI-CG-CA`, `MSS-XCI-CG-CA`, `SPL-XCI-CG-CA`, `SSS-XCI-CAF`, `MSS-XCI-CAF`, `SPL-XCI-CAF`, `SSS-XCI-286`, `MSS-XCI-286`, `SPL-XCI-286`, `SSS-XCI-286-ADV`, `MSS-XCI-286-ADV`, `SSS-XCI-PLY`, `MSS-XCI-PLY`, `SPL-XCI-PLY`, `SSS-XCI-PLY-CA`, `MSS-XCI-PLY-CA`, `SPL-XCI-PLY-CA`, `SSS-XCI-NB`, `MSS-XCI-NB`, `SPL-XCI-NB`, `SSS-XCI-NBPLY`, `MSS-XCI-NBPLY`, `SSS-XCI-CONCAST`, `MSS-XCI-CONCAST`, `SPL-XCI-CONCAST`, `button132`, `user_id`, `uniq_id`, `created`) values ('Lee', 'Tempest', 'TESTING', 'TESTING', 'TESTING', 'TESTING', 'AS', 'TESTING', '01452312581', 'lee@stormcreativedesign.co.uk', 'lee@stormcreativedesign.co.uk', 'Other', 'testing', 'Business', 'UPS Ground', '', '5', '', '7', '', '', '', '2', '', '2', '', '7', '', '', '', '', '', '', '', '8', '', '', '', '', '9', '', '10', '', '', '', '2', '', '', '6', '', '', '', '9', '4', '', '', '6', '6', '', '3', '4', '', '', '5', '6', '', '', '8', '9', '', '', '10', '', '1', '2', '', '', '4', '', '7', '9', '6', '4', '3', '', '', '2', '1', '', '1', '', '5', '', '7', '', '9', '6', '', '', '', '8', '', '', '4', '2', '', '', '9', '9', '9', '3', '', '', '', '6', '1', '', '', 'Submit', '0', 'daccee8b4f1abea24db1b93c9eaa7a4d2ce30033', '2018-02-15 11:58:28');
    )

    )

    )

    [7] => Array
    (
    [Email] => Array
    (
    [0] => An email with the details below could NOT be sent:
    [1] => To:lee@stormcreativedesign.co.uk, lee@stormcreativedesign.co.uk, lee@stormcreativedesign.co.uk
    [2] => Subject:Samples and Literature request
    [3] => From name:Hunter Panels
    [4] => From email:HunterPanels@HunterPanelsEmail.com
    [5] => CC:
    [6] => BCC:
    [7] => Reply name:
    [8] => Reply email:
    [9] => Attachments:
    [10] => Array
    (
    )

    [11] => Body:

    )

    )

    )
    GreyHead
    Hi ltempest,
    Sorry, there were a couple of typos in my example - now fixed I hope:
    <?php if ( !empty($form->data['SSS-HPLB']) ) { echo "$form->data['SSS-HPLB'] - HPLB"; } ?>
    And as SSS-HPLB was empty in your submission you wouldn't have seen anything much.
    I suggest that you add at least the <table> and <tr> tags and some visible text for testing.
    Bob
    ChronoForms technical support
    If you'd like to buy me a coffee or two, thank you very much
    L
    ltempest
    Bob,
    Updating the code I now have:
    Array['SSS-HPLB'] - HPLB
    In the table TD tag when the email comes through!
    The Debug code is:
    [div]Data Array
    Array
    (
    [chronoform] => SamplesLiteratureRequest
    [event] => submit
    [firstname] => Lee
    [lastname] => Tempest
    [companyname] => TESTING
    [address] => TESTING
    [address2] => TESTING
    [addresscity] => TESTING
    [addressstate] => AL
    [addresszip] => TESTING
    [phonenumber] => 01452312581
    [recipientemailaddress] => lee@stormcreativedesign.co.uk
    [orderedbyemailladdress] => lee@stormcreativedesign.co.uk
    [occupation] => Other
    [comments] => testing
    [addresstype] => Business
    [deliverytype] => UPS Ground
    [SSS-HPLB] => 10
    [MSS-HPLB] =>
    [SSS-FACER] =>
    [MSS-FACER] =>
    [MSS-022] =>
    [SSS-HS-FLC] =>
    [MSS-HS-FLC] =>
    [SSS-HS] =>
    [MSS-HS] =>
    [SPL-HS] =>
    [SSS-HS-F] =>
    [MSS-HS-F] =>
    [SPL-HS-F] =>
    [SSS-HS-CG] =>
    [MSS-HS-CG] =>
    [SPL-HS-CG] =>
    [SSS-HS-P] =>
    [MSS-HS-P] =>
    [SPL-HS-P] =>
    [SSS-HS-WF] =>
    [MSS-HS-WF] =>
    [SPL-HS-WF] =>
    [SSS-HS-HD] =>
    [MSS-HS-HD] =>
    [SPL-HS-HD] =>
    [SSS-HD-ADV] =>
    [MSS-HD-ADV] =>
    [SSS-HS-HDC] =>
    [MSS-HS-HDC] =>
    [SPL-HS-HDC] =>
    [SSS-HDC-ADV] =>
    [MSS-HDC-ADV] =>
    [SSS-HS-SCBC] =>
    [MSS-HS-SCBC] =>
    [SPL-HS-BC] =>
    [SSS-THS] =>
    [MSS-THS] =>
    [SPL-THS] =>
    [SSS-THS-CG] =>
    [MSS-THS-CG] =>
    [SPL-THS-CG] =>
    [SPL-HTS] =>
    [SPL-TS] =>
    [SSS-SUMP-ADV] =>
    [MSS-SUMP-ADV] =>
    [SSS-TEPS] =>
    [MSS-TEPS] =>
    [SSS-TDA] =>
    [MSS-TDA] =>
    [SSS-TAPBRO] =>
    [MSS-TAPBRO] =>
    [SSS-PRECUT-ADV] =>
    [MSS-PRECUT-ADV] =>
    [SSS-HS-TLC] =>
    [MSS-HS-TLC] =>
    [SSS-COOL] =>
    [MSS-COOL] =>
    [SPL-COOL] =>
    [SSS-COOL-IG] =>
    [SSS-COOL-SHNGLE] =>
    [MSS-COOL-SHNGLE] =>
    [SSS-HS-NB] =>
    [MSS-HS-NB] =>
    [SPL-HS-NB] =>
    [SSS-NB-IG] =>
    [SSS-HBINDER] =>
    [SPL-FI] =>
    [SPL-FI-WD] =>
    [SSS-XCI-BRO] =>
    [MSS-XCI-BRO] =>
    [SSS-XPL] =>
    [MSS-XPL] =>
    [SSS-XCI-F] =>
    [MSS-XCI-F] =>
    [SPL-XCI-F] =>
    [SSS-XCI-CG] =>
    [MSS-XCI-CG] =>
    [SPL-XCI-CG] =>
    [SSS-XCI-CG-CA] =>
    [MSS-XCI-CG-CA] =>
    [SPL-XCI-CG-CA] =>
    [SSS-XCI-CAF] =>
    [MSS-XCI-CAF] =>
    [SPL-XCI-CAF] =>
    [SSS-XCI-286] =>
    [MSS-XCI-286] =>
    [SPL-XCI-286] =>
    [SSS-XCI-286-ADV] =>
    [MSS-XCI-286-ADV] =>
    [SSS-XCI-PLY] =>
    [MSS-XCI-PLY] =>
    [SPL-XCI-PLY] =>
    [SSS-XCI-PLY-CA] =>
    [MSS-XCI-PLY-CA] =>
    [SPL-XCI-PLY-CA] =>
    [SSS-XCI-NB] =>
    [MSS-XCI-NB] =>
    [SPL-XCI-NB] =>
    [SSS-XCI-NBPLY] =>
    [MSS-XCI-NBPLY] =>
    [SSS-XCI-CONCAST] =>
    [MSS-XCI-CONCAST] =>
    [SPL-XCI-CONCAST] =>
    [g-recaptcha-response] => 03ANcjospylu_llB6Vh5CNRR2MwpIqZ1QZALbCWJMPt-A2kdBmXw7M6EHXNmxcgdV5FE9bFOF6mI2kSKJugzQv9R4bUGaA8hEfz5Zy2tOb7wAgwhtiRl33pTP2bLmRf_eNdhP6TuoGlvi7-Yya2W1OHHPbsenPJ3gOMv28fp3LPT-L0hR9tCaTP_d47T7KVu1Sd3q6CCVRurT6z3LWtLvNItZRSTMwWgFzGDeNA_y0RytYqHqOZJovFV0qeAgDEB3KR3cWdenu1Ib5gv_h6CCisYnsnyNpeDzlRmUr_KHrKA9QGdjSJrwW32WAMu6QUbYw9TgqOqvHhwC6xME8Z5nWUfLZsm-MXGZVneBypiG3F5rrJNRE8LJtle6JEcHAxprH6txMugHKdizs5YYDgyVdmXRWvOAPkFAwrkPsMQ7DVd4-RJSIxhshw669Bkjm4hvd5TznHMIxowWObr7eCuin2sILAkZT3fyK2iu4oJW5AtZgcYbPEeUr4k9kKCFaq-ts36PlunJIlmvWg4kyRokeqoe6_mLeQPPAEw
    [button132] => Submit
    [id] => 805
    [ip_address] => 80.192.27.244
    )
    Array
    (
    )
    [/div]
    [div]Errors
    Array
    (
    )
    [/div]
    [div]Debug Info
    Array
    (
    [9] => Array
    (
    [DB Save] => Array
    (
    [Queries] => Array
    (
    [0] => INSERT INTO `jc910bt_chronoengine_chronoforms_datatable_SamplesLitRequest` (`firstname`, `lastname`, `companyname`, `address`, `address2`, `addresscity`, `addressstate`, `addresszip`, `phonenumber`, `recipientemailaddress`, `orderedbyemailladdress`, `occupation`, `comments`, `addresstype`, `deliverytype`, `SSS-HPLB`, `MSS-HPLB`, `SSS-FACER`, `MSS-FACER`, `MSS-022`, `SSS-HS-FLC`, `MSS-HS-FLC`, `SSS-HS`, `MSS-HS`, `SPL-HS`, `SSS-HS-F`, `MSS-HS-F`, `SPL-HS-F`, `SSS-HS-CG`, `MSS-HS-CG`, `SPL-HS-CG`, `SSS-HS-P`, `MSS-HS-P`, `SPL-HS-P`, `SSS-HS-WF`, `MSS-HS-WF`, `SPL-HS-WF`, `SSS-HS-HD`, `MSS-HS-HD`, `SPL-HS-HD`, `SSS-HD-ADV`, `MSS-HD-ADV`, `SSS-HS-HDC`, `MSS-HS-HDC`, `SPL-HS-HDC`, `SSS-HDC-ADV`, `MSS-HDC-ADV`, `SSS-HS-SCBC`, `MSS-HS-SCBC`, `SPL-HS-BC`, `SSS-THS`, `MSS-THS`, `SPL-THS`, `SSS-THS-CG`, `MSS-THS-CG`, `SPL-THS-CG`, `SPL-HTS`, `SPL-TS`, `SSS-SUMP-ADV`, `MSS-SUMP-ADV`, `SSS-TEPS`, `MSS-TEPS`, `SSS-TDA`, `MSS-TDA`, `SSS-TAPBRO`, `MSS-TAPBRO`, `SSS-PRECUT-ADV`, `MSS-PRECUT-ADV`, `SSS-HS-TLC`, `MSS-HS-TLC`, `SSS-COOL`, `MSS-COOL`, `SPL-COOL`, `SSS-COOL-IG`, `SSS-COOL-SHNGLE`, `MSS-COOL-SHNGLE`, `SSS-HS-NB`, `MSS-HS-NB`, `SPL-HS-NB`, `SSS-NB-IG`, `SSS-HBINDER`, `SPL-FI`, `SPL-FI-WD`, `SSS-XCI-BRO`, `MSS-XCI-BRO`, `SSS-XPL`, `MSS-XPL`, `SSS-XCI-F`, `MSS-XCI-F`, `SPL-XCI-F`, `SSS-XCI-CG`, `MSS-XCI-CG`, `SPL-XCI-CG`, `SSS-XCI-CG-CA`, `MSS-XCI-CG-CA`, `SPL-XCI-CG-CA`, `SSS-XCI-CAF`, `MSS-XCI-CAF`, `SPL-XCI-CAF`, `SSS-XCI-286`, `MSS-XCI-286`, `SPL-XCI-286`, `SSS-XCI-286-ADV`, `MSS-XCI-286-ADV`, `SSS-XCI-PLY`, `MSS-XCI-PLY`, `SPL-XCI-PLY`, `SSS-XCI-PLY-CA`, `MSS-XCI-PLY-CA`, `SPL-XCI-PLY-CA`, `SSS-XCI-NB`, `MSS-XCI-NB`, `SPL-XCI-NB`, `SSS-XCI-NBPLY`, `MSS-XCI-NBPLY`, `SSS-XCI-CONCAST`, `MSS-XCI-CONCAST`, `SPL-XCI-CONCAST`, `button132`, `user_id`, `uniq_id`, `created`) values ('Lee', 'Tempest', 'TESTING', 'TESTING', 'TESTING', 'TESTING', 'AL', 'TESTING', '01452312581', 'lee@stormcreativedesign.co.uk', 'lee@stormcreativedesign.co.uk', 'Other', 'testing', 'Business', 'UPS Ground', '10', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Submit', '0', '95c292dd4b7c06f78e3b335e071b7cace65452e2', '2018-02-20 13:16:57');
    )

    )

    )

    [7] => Array
    (
    [Email] => Array
    (
    [0] => An email with the details below was sent successfully:
    [1] => To:lee@stormcreativedesign.co.uk, lee@stormcreativedesign.co.uk, lee@stormcreativedesign.co.uk
    [2] => Subject:Samples and Literature request
    [3] => From name:Hunter Panels
    [4] => From email:HunterPanels@HunterPanelsEmail.com
    [5] => CC:
    [6] => BCC:
    [7] => Reply name:
    [8] => Reply email:
    [9] => Attachments:
    [10] => Array
    (
    )

    [11] => Body:
    <body style="background-color:#f5f8fa;">
    <table align="center" border="0" cellpadding="5" cellspacing="5" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">

    <table align="center" border="0" cellpadding="5" cellspacing="5" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">
    <tr>
      <td colspan="2"><img src="https://www.hunterpanels.com/images/email-images/hunterpanels-emailheader.jpg" alt="Hunter Panels" width="800" height="85" /></td>
    </tr>

      <tr>
      <td colspan="2">
        <p>Dear Lee Tempest,</p>
        <p>Thank you for your request for literature and samples from Hunter Panels.<br />Your package will be shipped to the following address:</p>
      </td>
    </tr>
      <tr>
      <td colspan="2" style="padding: 15px;background-color:#faeba5;text-align:center;"><span style="font-size:110%;"><strong>Lee&nbsp;Tempest</strong><br />TESTING&nbsp;&nbsp;&nbsp;01452312581</span><br />TESTING, TESTING<br />TESTING, AL, TESTING</td>
    </tr>
    </table>

    <table align="center" border="0" cellpadding="5" cellspacing="0" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">
      <tr style="background-color: #D9D9D9">
        <td>Address type</td><td>Business</td>
        <td>Delivery type</td><td>UPS Ground</td>
      </tr>
      <tr>
        <td colspan="2">Recipient email address</td>
        <td colspan="2">lee@stormcreativedesign.co.uk</td>
      </tr>
      <tr style="background-color: #D9D9D9">
        <td colspan="2">Ordered by email address</td>
        <td colspan="2">lee@stormcreativedesign.co.uk</td>
      </tr>
      <tr>
        <td colspan="2">Occupation</td>
        <td colspan="2">Other</td>
      </tr>
      <tr style="background-color: #D9D9D9">
        <td>Comments</td>
        <td colspan="3">testing</td>
      </tr>
      <tr>
      <td colspan="4" style="padding: 5px;background-color:#669597;text-align:center;color:#fff;">You will receive a UPS tracking number sent to this email address lee@stormcreativedesign.co.uk</td>
    </tr>
    </table>

    <table align="center" border="0" cellpadding="5" cellspacing="5" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">
    <tr>
      <td colspan="4"><br /></td>
    </tr>
      <tr>
      <td colspan="4" style="padding: 15px;text-align:center;font-weight:bold;">A copy of your order is shown below.</td>
    </tr>
    <tr>
      <td colspan="4" style="padding: 5px;background-color:#669597;text-align:center;color:#fff;font-size:115%;"><strong>Roofing Application Samples &amp; Literature</strong></td>
    </tr>
    <tr>
      <td colspan="4" >
        <table align="center" border="1" cellpadding="5" cellspacing="5" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">
    <tr>
      <td class="black" width="40%" style="background-color: #000;color: #fff">Product</td><td class="black" width="20%" style="background-color: #000;color: #fff">Single Sheet</td><td class="black" width="20%" style="background-color: #000;color: #fff">Package of 25</td><td class="black" width="20%" style="background-color: #000;color: #fff">Samples</td>
    </tr>
    <tr>
    <td>Roofing Product Line Brochure</td>
      <td>Array['SSS-HPLB'] - HPLB</td>
    <td> - HPLB</td><td> </td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Polyiso Facer Guide</td><td> - FACER</td><td> - FACER</td><td> </td>
    </tr>
    <tr>
      <td>R-Values Pocket Loading Card (Pkg of 50)</td><td> </td><td> - 022</td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Flat Polyiso Line Card</td><td> - HS-FLC</td><td> - HS-FLC<td></td><td> </td>
    </tr>

    <tr>
      <td>H-Shield</td><td> - HS</td><td> - HS</td><td> - SPL-HS</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>H-Shield Foil</td><td> - HS-F</td><td> - HS-F</td><td> - SPL-HS-F</td>
    </tr>

    <tr>
      <td>H-Shield CG</td><td> - HS-CG</td><td> - HS-CG</td><td> - SPL-HS-CG</td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>H-Shield Premier</td><td> - HS-P</td><td> - HS-P</td><td> - SPL-HS-P</td>
    </tr>

    <tr>
      <td>H-Shield WF</td><td> - HS-WF</td><td> - HS-WF</td><td> - SPL-HS-WF</td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>H-Shield HD</td><td> - HS-HD</td><td> - HS-HD</td><td> - SPL-HS-HD</td>
    </tr>

    <tr>
      <td>H-Shield HD Advantage</td><td> - HD-ADV</td><td> - HD-ADV<td></td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>H-Shield HD Composite CG</td><td> - HS-HDC</td><td> - HS-HDC</td><td> - SPL-HS-HDC</td>
    </tr>

    <tr>
      <td>H-Shield HD Composite CG Advantage</td><td> - HDC-ADV</td><td> - HDC-ADV</td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>H-Shield Straight Cut &amp; Bevel Cut</td><td> - HS-SCBC</td><td> - HS-SCBC</td><td> - SPL-HS-BC</td>
    </tr>

    <tr>
      <td>Tapered H-Shield</td><td> - THS</td><td> - THS</td><td> - SPL-THS</td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Tapered H Shield CG</td><td> - THS-CG</td><td> - THS-CG</td><td> - SPL-THS-CG</td>
    </tr>

    <tr>
      <td>Hinged Target Sump</td><td></td><td></td><td> - SPL-HTS</td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Target Sump Sample (25 psi)</td><td>&nbsp;</td><td>&nbsp;</td><td> - SPL-TS</td>
    </tr>

    <tr>
      <td>Sump Advantage</td><td> - SUMP-ADV</td><td> - SUMP-ADV<td></td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Pre-Cut Hips &amp; Valleys</td><td> - TPS</td><td> - TPS</td><td> </td>
    </tr>

    <tr>
      <td>Pre-cut Advantage</td><td> - PRECUT-ADV</td><td> - PRECUT-ADV<td></td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Tapered Extended Panel Advantage</td><td> - TEPS</td><td> - TEPS</td><td> </td>
    </tr>

    <tr>
      <td>Tapered Pre Cut Polyiso Brochure</td><td> - TAPBRO</td><td> - TAPBRO</td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Tapered Line Card</td><td> - TLC</td><td> - TLC</td><td> </td>
    </tr>

    <tr>
      <td>Tapered Design Advantage</td><td> - TDA</td><td> - TDA</td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Cool-Vent</td><td> - COOL</td><td> - COOL</td><td> - SPL-COOL</td>
    </tr>

    <tr>
      <td>Cool-Vent Installation Guide</td><td> - SSS-COOL-IG</td><td> </td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Cool-Vent and Shingles</td><td> - COOL-SHNGL</td><td> - COOL-SHNGL</td><td> </td>
    </tr>
    <tr>
      <td>H-Shield NB</td><td> - HS-NB</td><td> - HS-NB</td><td> - SPL-HS-NB</td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Nailboard Installation Guide</td><td> - SSS-NB-IG</td><td> </td><td> </td>
    </tr>

    <tr>
      <td>Fulfilled Binder (Includes Binder + Literature Inserts)</td><td> - BI</td><td> </td><td> </td>
    </tr>

    <tr style="background-color: #D9D9D9">
      <td>Hunter Panels SIP SD/HD Fastener Sample</td><td> </td><td> </td><td> - SPL-FI</td>
    </tr>

    <tr>
      <td>Hunter Panels SIP WD Fastener Sample</td><td> </td><td> </td><td> - SPL-WD</td>
    </tr>
    </table>
      </td>
    </tr>
    <tr>
      <td colspan="4"><br /><br /></td>
    </tr>
    <tr>
      <td colspan="4" style="padding: 5px;background-color:#669597;text-align:center;color:#fff;font-size:115%;"><strong>Xci Wall Application Samples &amp; Literature</strong></td>
    </tr>
    <tr>
      <td colspan="4" >
        <table align="center" border="1" cellpadding="5" cellspacing="5" width="810" style="background-color:#fff;border-collapse: collapse;font-family: Helvetica, Arial, sans-serif;">
    <tr>
      <td class="black" width="40%" style="background-color: #000;color: #fff">Product</td><td class="black" width="20%" style="background-color: #000;color: #fff">Single Sheet</td><td class="black" width="20%" style="background-color: #000;color: #fff">Package of 25</td><td class="black" width="20%" style="background-color: #000;color: #fff">Samples</td>
    </tr>
    <tr>
      <td>Xci Continuous Insulation Brochure</td><td> - XCI-BRO</td><td> - XCI-BRO</td><td> </td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Xci Product Line</td><td> - XPL</td><td> - XPL</td><td> </td>
    </tr>
    <tr>
      <td>Xci Foil</td><td> - XCI-F</td><td> - XCI-F</td><td> - XCI-F</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Xci CG</td><td> - XCI-CG</td><td> - XCI-CG</td><td> - SPL-XCI-CG</td>
    </tr>
    <tr>
      <td>Xci CG Class A</td><td> - XCI-CG-CA</td><td> - XCI-CG-CA</td><td> - SPL-XCI-CG-CA</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Xci Class A</td><td> - XCI-CAF</td><td> - XCI-CAF</td><td> - SPL-XCI-CAF</td>
    </tr>
    <tr>
      <td>Xci 286</td><td> - XCI-286</td><td> - XCI-286</td><td> - SPL-XCI-286</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>XCI 286 Advantage</td><td> - XCI-286-ADV</td><td> - XCI-286-ADV</td><td> </td>
    </tr>
    <tr>
      <td>Xci Ply</td><td> - XCI-PLY</td><td> - XCI-PLY</td><td> - SPL-XCI-PLY</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Xci Ply Class A</td><td> - XCI-PLY-CA</td><td> - XCI-PLY-CA</td><td> - XCI-PLY-CA</td>
    </tr>
    <tr>
      <td>Xci NB</td><td> - XCI-NB</td><td> - XCI-NB</td><td> - SPL-XCI-NB</td>
    </tr>
    <tr style="background-color: #D9D9D9">
      <td>Xci NB/Ply Advantage</td><td> - XCI-NBPLY</td><td> - XCI-NBPLY</td><td> </td>
    </tr>
    <tr>
      <td>Xci ConCast</td><td> - XCI-CONCAS</td><td> - XCI-CONCAS</td><td> - SPL-XCI-CONCAS</td>
    </tr>
    </table>
      </td>
    </tr>

    <tr>
      <td colspan="4"><br /><br /></td>
    </tr>
    <tr>
      <td colspan="4" style="padding: 15px;background-color:#faeba5;text-align:center;">
        <p>For more information on Hunter Panels products, please visit <a href="https://www.hunterpanels.com">www.hunterpanels.com</a>.</p>
        <p>For questions regarding your order, please contact:</p><p>Kyle Ryerson at <a href="mailto:kyle.ryerson@hpanels.com">Kyle.Ryerson@hpanels.com</a> or by phone 207-228-6337</p>
      </td>
    </tr>
    </table>

    </table>
    </body>
    )

    )

    )
    [/div]
    GreyHead
    Hi ltempest,
    I don't immediately see where the Array is coming from - please add a couple of {} and see if that helps:
    <?php if ( !empty($form->data['SSS-HPLB']) ) { echo "{$form->data['SSS-HPLB']} - HPLB"; } ?>
    Bob
    ChronoForms technical support
    If you'd like to buy me a coffee or two, thank you very much
    L
    ltempest
    Bob,
    Genius, thanks that now works and only adds the additional text if a value is entered on the form.
    Thanks so much for all your help.
    Lee
    L
    ltempest
    Bob,
    I'm now migrating this form to v6! can you offer any advice on how I can change:
    <?php if ( !empty($form->data['SSS-HPLB']) ) { echo "{$form->data['SSS-HPLB']} - HPLB"; } ?>
    to fit v6?

    ​Thanks​
    ​Lee
    GreyHead
    Hi Lee,
    In a PHP action remove the PHP tags and replace $form with $this, I think that will work.
    Bob
    ChronoForms technical support
    If you'd like to buy me a coffee or two, thank you very much