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.

Archive /

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

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

Quick Newsletter Signup


Reply


3 Posts   1501 Views

Avatar
Briohny

Community Member, 199 Posts

23 September 2008 at 1:42am

I have the Newsletter module up and running perfectly. It uses a separate page, captures names, emails etc and writes perfectly to the database. What i would like to do is just have a simple form (name & email) to appear on every page (i.e. in the right hand column). It would do exactly as the newsletter form (i.e. write to newsletter mailing list) however you would be able to sign up from any page without having to go to a specific 'newsletter page'.

I have tried this code:

http://doc.silverstripe.com/doku.php?id=recipes:forms

however the submissions are not being recorded in the newsletter mailing list.

Any ideas?

Avatar
Liam

Community Member, 470 Posts

23 September 2008 at 2:20am

Have you edited this line to include the newsletter group name in your database?

if($group = DataObject::get_one('Group', "Code = 'my-group'")) {
$member->Groups()->add($group);
}

You need to change my-group to the name of your newsletter in the form of my-newsletter-name

Avatar
Briohny

Community Member, 199 Posts

23 September 2008 at 2:41am

Cheers LeeUmm - that's what i was doing wrong... typing the newsletter name in the wrong format.

thanks for your help. :)