Send result of checkbox to email in chronoforms 6

woetertoeter2 15 Apr, 2017
Hey,

I am trying to set the result of the a checkbox in the mail sent to the user.
I read that I need to put the 'arrayhandler' in front of the email, but in CF6 there is no arrayhandler?

I can get the variable from the $_POST, but this does not work in the mail (works on the confirmation page though)

Any help?

Kr

W
Max_admin 16 Apr, 2017
Hi W,

This is a "checkbox" or a "Checkboxes group" ?

what do you have in the email body and what do you get in the email exactly ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
woetertoeter2 16 Apr, 2017
Hey Max,

It concerns a checkbox group. What I did is just use the form "Fields Events", that you can use as a template when creating a new form.

There are two checkboxes groups.

In the body of the mail I have defined the following:
"
Testing checkboxes
{data:checkboxes2[]}
"

In the actual body of the mail I have just
"
Testing checkboxes
"

Kr

W
Max_admin 16 Apr, 2017
Answer
Hi W,

You can't use the brackets in the {commands}, please use this:
{data:checkboxes2}

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
woetertoeter2 16 Apr, 2017
Seems to work.
Maybe you can update the example (for the default contact form) to include this.

Another question, is there another way to get these values rather then the {} notation?
Thing is that this is not formattable, so if I want to create a formatted mail, I will not be able to put the answers on a seperate line for example.

Anyway allready tanx for the swift and rapid response !

Kr

W
Max_admin 16 Apr, 2017
Hi W,

Thank you, I have updated the form for the next update.

The {} notation returns the value, you can place it inside HTML tags and it will be formatted, or what are you trying to achieve exactly ?

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
woetertoeter2 16 Apr, 2017
Well,

I am sending a confirmation email with the answers filled in.

Currently it looks like this :
"Reden van aanvraag:["gedagvaard","procedure"]"

Would be nicer if I could do something like
"Reden van aanvraag: "gedagvaard","procedure""

(not a big of deal, but a user is not used to see [])

Kr

W
SPABO 17 Apr, 2017
Awaiting for a nice Editor in the (o.a.) Email template...
Hopefully in the next update..
GreyHead 17 Apr, 2017
Hi W,

The checkbox group returns an array of values and the CFv6 code seems to convert that into the string you see. There is no Handle Arrays action that I can see but you can do it with a Custom Code action using code like this
<?php
if ( $this->data['checkboxes1'] && is_array($this->data['checkboxes1']) ) {
  $this->data['checkboxes1'] = implode(', ', $this->data['checkboxes1'] );
}
?>

Bob
SPABO 17 Apr, 2017
How more complicated can we make it Bob ???
Max_admin 17 Apr, 2017
Hi,

The current format is the format preferred when saving the data into database, and its human readable, but I will try to have a better solution for emails in the next update.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.