Not all dynamic fields are coming through to the e-mail

How to fix missing dynamic fields in ChronoForms emails.

Overview

The issue occurs when spaces or incorrect entries are present in the dynamic field settings.
Ensure all dynamic field boxes, like Dynamic Subject, contain only the exact field name without any spaces, brackets, or quotes, and leave the corresponding static fields completely empty.

Answered
rc rcadmin 02 Jul, 2014
I have the following custom code to send the e-mail to the user based on the subject (this works)
<?php
$emails_2 = array(
  'General Queries'=>'123@xyz.school.nz', 
  'Absentees'=>'456@xyz.school.nz',
  'Enrolments'=>'123@xyz.school.nz',
  'Sports'=>'123@xyz.school.nz',
  'Accounts'=>'156@xyz.school.nz',
  'IT Queries'=>'1245@xyz.school.nz'
);
$form->data['to_email'] = $emails_2[$form->data['Subject']];
?>


The e-mail settings are as follows:
The only static field is the "From E-mail" -> abc@xyz.school.nz

My other entries are dynamic i.e.
Dynamic to -> to_email
Dynamic subject -> Subject
Dynamic reply to name - > FirstName
Dynamic reply e-mail -> Email

Debug Info
Array
(
    [chronoform] => Contact
    [event] => submit
    [FirstName] => Andre
    [Surname] => Smith
    [Email] => andre@gmail.com
    [Phone] => 6494895417
    [Subject] => IT Queries
    [message] => ee
    [recaptcha_challenge_field] => 03AHJ_VuvNcqBZbR7hOILJ0_Ir6ebQGM50Hxh8J8TzTXVKiuMWLuZoojjlxCCJobjv3LLUx1zzMuObCDp_sq1mENwf_Wn_2kDWFjrUareCR3H5G2KQzbG4Bk0WDzniiAQ6MaRckj9gdcGQ1EVv-Fwky8Abk51VRM0pdkjMdcfSqNoPKahc0RppNNHGCjExwp3IBQsUCMvgArqNclpT9f9-jKsUKRwAL74IdQ
    [recaptcha_response_field] => andmbui Uni
    [Submit] => Submit
    [to_email] => 12345@xyz.school.nz
    [ip_address] => 124.150.174.28
)


Array
(
    [5] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => 12345@xyz.school.nz
                    [2] => Subject:
                    [3] => From name:
                    [4] => From email:abc@xyz.school.nz
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Body:
<table>
<tr><td>CONTACT DETAILS</td><td></td></tr>
<tr><td>First Name</td><td>Andre</td></tr>
<tr><td>Surname</td><td>Basel</td></tr>
<tr><td>Email</td><td>andre.basel@gmail.com</td></tr>
<tr><td>Phone</td><td>6494895417</td></tr>
<tr><td>MESSAGE</td><td></td></tr>
<tr><td>Subject</td><td>IT Queries</td></tr>
<tr><td>Message</td><td>ee</td></tr>
<tr><td>VALIDATION</td><td></td></tr>
<tr><td>Array</td><td></td></tr>
</table><br /><br />IP: 124.150.174.28
                )

        )

)


None of the fields are being pulled through... I must be missing something obvious
Gr GreyHead 02 Jul, 2014
Answer
Hi rcadmin,

What do you have in e.g. the Dynamic Subject box? It should be just Subject with no brackets or quotes and the Static Subject should be empty - not even a space. I can see that the Subject is included OK in the message body.

Bob
rc rcadmin 02 Jul, 2014
Aaagh there appeared to be a space in there
This topic is locked and no more replies can be posted.