1792 Posts in 588 Topics by 560 members
|Go to End|
4 February 2009 at 10:24pm
I send mail wit Email_Template.
My problem is that I have a checkbox and I'm unable to print data in my email template because I have an error:
ArrayData::__construct: Parameter needs to be an object or associative array
At line 39 in E:\_silverstripe_cms\silverstripe\sapphire\core\ArrayData.php
The proble is how write data in checkbox. Can you hel me?
This is my checkbox:
$name = "topics",
$title = "Settori d'interesse:",
$source = array(
"1" => "Information Management",
"2" => "Application Integration (EAI)",
"3" => "System Management",
$value = ""
and in GenericEmail.ss I wrote: Settori d'interesse: $topics
5 February 2009 at 8:34pm
5 February 2009 at 11:37pm
I think the form returns an array ... So depending on what you need to do , you could either implode it into a string (for , say , displaying it in a mail) and feed it to the template or convert it into viewable data for Silverstripe using ArrayData() ...
Good luck !
12 February 2009 at 3:28am
Sorry but I'm unable..I'm not able to show the result of my checkbox in my e-mail
$e = new Email_Template();
$e->From = "firstname.lastname@example.org";
$e->To = "email@example.com";
$e->Subject = "Hi there";
$e->Body = "I just really wanted to email you and say hi.";*/
Where $data contain all data in my form also checkbox
12 February 2009 at 9:47pm
Well.. A very easy way is converting the values to a string .. ;-)
$data['Checkbox_String'] = implode("<br/>",$data['Checkboxes']);
|Go to Top|