Checkbox group values and Email

gatekeepa123 06 May, 2014
Hi everybody,

i've a problem with chronoforms 5.0 RC5. i'm trying to send multiple values from a checkbox group via email, but only the first value checked is shown.

I've added "Handle Arrays" and {fieldname} via setup.

best regards,
marc
GreyHead 06 May, 2014
Hi marc,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab in CFv4 or the Setup tab in CFv5.

Bob
gatekeepa123 08 May, 2014
Hey Bob,

thank you for your quick answer. I added the Debugger action into On Submit event and checked BOTH option in field name "Produkte": "Printmedium" and "Internet". We can see the problem with the array here: Only the option "Internet" is shown in the Email

Debugger:
Data Array
Array
(
    [chronoform] => kontakt
    [event] => submit
    [Produkte] => Internet
    [Themenbereiche] => rechnung
    [Firma] => test
    [Name] => test
    [Straße:] => test
    [PLZ] => test
    [Ort] => test
    [Email] => test@test.de
    [Telefon] => 1234
    [nachricht] => test nachricht
    [zeit] => vormittags
    [uhrzeit] => 12
    [button22] => Senden
    [ip_address] => 178.203.234.27
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
    [4] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:marc.grube@pixeltopf.com
                    [2] => Subject:Kontaktanfrage auf verlag-wagner.de
                    [3] => From name:Formmailer
                    [4] => From email:formmailer@verlag-wagner.de
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Body:
<table>
<tr><td></td><td></td></tr>
<tr><td>Array</td><td>Internet</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Array</td><td>rechnung</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Firma:</td><td>test</td></tr>
<tr><td>Name:</td><td>test</td></tr>
<tr><td>Straße:</td><td>test</td></tr>
<tr><td>PLZ:</td><td>test</td></tr>
<tr><td>Ort:</td><td>test</td></tr>
<tr><td>E-Mail</td><td>test@test.de</td></tr>
<tr><td>Telefon:</td><td>1234</td></tr>
<tr><td>Nachricht (optional)</td><td>test nachricht</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Container #24</td><td></td></tr>
<tr><td>Array</td><td>vormittags</td></tr>
<tr><td>ab folgender Uhrzeit:</td><td>12</td></tr>
</table>

Poster's IP address:178.203.234.27
                )

        )

)

------------

Dummy Mail:

Array	Internet
	
Array	rechnung
	
Firma:	test
Name:	test
Straße:	test
PLZ:	test
Ort:	test
E-Mail	test@test.de
Telefon:	1234
Nachricht (optional)	test nachricht
	
Container #24	
Array	vormittags
ab folgender Uhrzeit:	12
Poster's IP address:178.203.234.27 

-------

E-Mail Template:

<table>
<tr><td></td><td>{custom}</td></tr>
<tr><td>Array</td><td>{Produkte}</td></tr>
<tr><td></td><td>{custom}</td></tr>
<tr><td>Array</td><td>{Themenbereiche}</td></tr>
<tr><td></td><td>{custom}</td></tr>
<tr><td>Firma:</td><td>{Firma}</td></tr>
<tr><td>Name:</td><td>{Name}</td></tr>
<tr><td>Straße:</td><td>{Straße:}</td></tr>
<tr><td>PLZ:</td><td>{PLZ}</td></tr>
<tr><td>Ort:</td><td>{Ort}</td></tr>
<tr><td>E-Mail</td><td>{Email}</td></tr>
<tr><td>Telefon:</td><td>{Telefon}</td></tr>
<tr><td>Nachricht (optional)</td><td>{nachricht}</td></tr>
<tr><td></td><td>{custom}</td></tr>
<tr><td>Container #24</td><td>{container}</td></tr>
<tr><td>Array</td><td>{zeit}</td></tr>
<tr><td>ab folgender Uhrzeit:</td><td>{uhrzeit}</td></tr>
</table>
GreyHead 08 May, 2014
Hi Marc,

If produkte is a checkbox group then the input needs to have an array name e.g. produkte[]

I don't understand why you are seeing 'array' in the email body where I assume you should have the input Labels?

Bob

PS Using Straße as an input name may give problems as only [a-z],[0-9] and underscore are permitted. Please change that to Strasse
gatekeepa123 16 May, 2014
Hey Bob,

I changed Straße to Strasse like you proposed.

Still can't get the Arrays to work. You can see my settings on the attached screenshots. I only get the first Value from the Checkbox Groups in the E-Mail and still have the "Array"-Error.
GreyHead 16 May, 2014
HI Marc,

If produkte is a checkbox group then the input needs to have an array name e.g. produkte[] I tlooks as though you changed the id and not the name.

Bob
gatekeepa123 16 May, 2014
Hey Bob,

I tried "produkte[]" in "Field Name", no success. Where do i need to put the Array-Brackets?
GreyHead 16 May, 2014
Hi Marc,

Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

Bob
GreyHead 17 May, 2014
Hi Marc,

No problem here once I'd added the [] to the Checkbox Group names.
Array
(
    [option] => com_chronoforms5
    [chronoform] => kontakt_marc
    [event] => submit
    [Produkte] => Printmedium,Internet
    [Themenbereiche] => werbung,rechnung,mediaberater,sonstige,erscheinungstermine,anzeigenschluss
    [Firma] => Firma
    [Name] => Name
    [Straße:] => Straße:
    [PLZ] => PLZ
    [Ort] => Ort
    [Email] => example@example.com
    [Telefon] => 1234567890
    [nachricht] => nachricht
    [zeit] => Array
        (
            [0] => vormittags
            [1] => nachmittags
        )

    [uhrzeit] => uhrzeit
    [button22] => Senden
    [ip_address] => 92.139.249.220
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
    [4] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:marc.grube@pixeltopf.com
                    [2] => Subject:Kontaktanfrage auf verlag-wagner.de
                    [3] => From name:Formmailer
                    [4] => From email:formmailer@verlag-wagner.de
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Body:
<table>
<tr><td></td><td></td></tr>
<tr><td>Array</td><td>Printmedium,Internet</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Array</td><td>werbung,rechnung,mediaberater,sonstige,erscheinungstermine,anzeigenschluss</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Firma:</td><td>Firma</td></tr>
<tr><td>Name:</td><td>Name</td></tr>
<tr><td>Straße:</td><td>Straße:</td></tr>
<tr><td>PLZ:</td><td>PLZ</td></tr>
<tr><td>Ort:</td><td>Ort</td></tr>
<tr><td>E-Mail</td><td>example@example.com</td></tr>
<tr><td>Telefon:</td><td>1234567890</td></tr>
<tr><td>Nachricht (optional)</td><td>nachricht</td></tr>
<tr><td></td><td></td></tr>
<tr><td>Container #24</td><td></td></tr>
<tr><td>Array</td><td>array (
  0 => 'vormittags',
  1 => 'nachmittags',
)</td></tr>
<tr><td>ab folgender Uhrzeit:</td><td>uhrzeit</td></tr>
</table><br /><br />IP: 92.139.249.220
                )

        )

)

Bob
gatekeepa123 17 May, 2014
Hey Bob,

thank you again for the time you're investing to help me.
I just added a new checkbox group with brackets and it works; well kinda:

In the E-Mail Template I've:

{checkbox_group}

E-Mail then says for example:

array ( 0 => 'Printmedium', 1 => 'Internet', )

Is there any way to list the values like:

Printmedium,
Internet

I tried {checkbox_group[0]}, {checkbox_group[1]}, etc... but that doesnt work.
GreyHead 17 May, 2014
Hi Marc,

You need to add checkbox_group to the list in the Handle Arrays action if you want the arrays handed for you. (The same with the Zeit checkboxes later in the form.)

Bob
This topic is locked and no more replies can be posted.