Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » How to email data from CheckboxSetField in a Form

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1141 Views
  • Martin Pales
    Community Member
    19 Posts

    How to email data from CheckboxSetField in a Form Link to this post

    I have a CheckboxSetField in my form and would like to send those data in an email when the form is submitted. However, I am getting the following errors:

    FATAL ERROR: ArrayData::__construct: Parameter needs to be an object or associative array
    At line 39 in C:\Program Files\wamp\www\web\sapphire\core\ArrayData.php


    FATAL ERROR: Object::__call() Method 'forTemplate' not found in class ''
    At line 199 in C:\Program Files\wamp\www\web\sapphire\core\Object.php

    user_error(Object::__call() Method 'forTemplate' not found in class '',256)
    line 199 of Object.php


    line 420 of ViewableData.php

    When I added forTemplate to the ArrayData.php, the second error was gone.

    I use this code to populate template of the email:

             'FirstName' => $data['FirstName'],
             'LastName' => $data['LastName'],
             'Title' => $data['Title'],
             'Company' => $data['Company'],
             'Reason' => $data['Reason'],
             'Email' => $data['Email'],
             'Phone' => $data['Phone']

    where Reason is an array data of the CheckboxSetField in my form.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.