Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Customizing output in email.


Go to End


1473 Views

Avatar
me.yay

Community Member, 14 Posts

26 February 2010 at 3:57am

Hi Silverstripers,

i created my own contact form following the ssbits tutorial.

This is the ContactForm_method() from the page_Controller

new CheckboxSetField($name = "myField", $title = "myField Description", $source = array(
 "Choise1" => "Choise1", "Choise2" => "Choise2", "Choise3" => "Choise3"))

The email-template is populated and $myField is available and shown in the emails that are send.

When i receive the email $myField is replaced with 'Array( "Choise1" => "Choise1", "Choise2" => "Choise2", "Choise3" => "Choise3")'

When i try to use a flat array ( Array("Choise1", "Choise2", "Choise3")) the first checkbox is allways preselected.

How can i change the output from $myField during population of the email template?
I need an output like: "choise1, choise2, choise3" without any php specific output like Array().

Kind regards
Metin