Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Quick Newsletter Signup

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: 1397 Views
  • Briohny
    Avatar
    Community Member
    199 Posts

    Quick Newsletter Signup Link to this post

    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?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Quick Newsletter Signup Link to this post

    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

  • Briohny
    Avatar
    Community Member
    199 Posts

    Re: Quick Newsletter Signup Link to this post

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

    thanks for your help.

    1397 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.