Jump to:

10997 Posts in 2731 Topics by 1822 members

All other Modules

SilverStripe Forums » All other Modules » [SOLVED ] Newsletter subscription empty database recipient field

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 932 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    [SOLVED ] Newsletter subscription empty database recipient field Link to this post

    Hello Everyone

    I found out one reason why when you use the SubscribeForm for a newsletter it creates blank entries instead of filling them :

    The name of the fields wich are used in the form are related to the array of variables used to populate the database.

    If you want to change the original field names used in the form (let's say from "Email adress" to "Something else" you have to edit

    SubscribeForm.php where you will find around line 25 this array :

       static $obj_field_map = array(
          'Email address' => 'Email',
          'First name' => 'FirstName',
          'Last name' => 'Surname',
       );

    you will have to change the first row from 'Email address' => 'Something else'

    to get it work

       static $obj_field_map = array(
          'Something else' => 'Email',
          'First name' => 'FirstName',
          'Last name' => 'Surname',
       );

    It is the same for the other fields

    Hope this help

    T

    932 Views
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.