Jump to:

11004 Posts in 2735 Topics by 1824 members

All other Modules

SilverStripe Forums » All other Modules » Newsletter Module

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 2211 Views
  • Rossel
    Community Member
    18 Posts

    Re: Newsletter Module Link to this post

    Try taking a look in your database at the groups table it will show you what id your newsletter group is.

    Your "Page not found" error is, Im guessing, because i was redirecting everyone who was not a member to my signup page, which you don't have, see this line:

    return Director::redirect($this->Link("/sign-up/?s=1&e=" . $email));

    You should be able to just add them to your newsletter group if you don't want them to have to become a member first.

    try this or something like it instead:

    function doSubscribeForm($data, $form){
       $email = Convert::raw2sql($data['Email']); // prevent sql injection

       //check if newsletter exists first
       if($newsletter_group = DataObject::get_one('Group', "ID = 4")):
          if($existing_member = DataObject::get_one("Member", "Email = '$email'")):
             $member = $this->CurrentMember();
             //If current member matches the existing member.
             if($member->ID == $existing_member->ID):
                return Director::redirect(Director::BaseURL() . 'Security/login');
                return Director::redirectBack();
             //create new member and add them to newsletter group
             $member = new Member();
       return Director::redirectBack();

  • benni91
    Community Member
    72 Posts

    Re: Newsletter Module Link to this post

    Ok now the form adds the address to the newsletter module. But, after adding an mail there's no success message.
    And after adding the functions my jquery image slider crashes. the console says

    /termine/?flush=1:31 Uncaught TypeError: Cannot call method 'css' of null
    jquery.load.slider.js:2 Uncaught TypeError: Cannot call method 'nivoSlider' of null

    what's that?!

    Regards Benni

    EDIT:// Found something which should fix it. This jQuery.noConflict thing.
    But after Adding this. The Subscriberform doesn't work. It just redirects to /security and doesn't give the mail to the module

Page: 1 2 3
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.