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.

All other Modules /

Discuss all other Modules here.

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

[SOLVED ] Newsletter subscription empty database recipient field


Go to End


1459 Views

Avatar
servalman

Community Member, 211 Posts

4 November 2009 at 6:45am

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