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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

Newsletter Module

Go to End

18 Posts   3512 Views


Community Member, 18 Posts

13 February 2012 at 10:21pm

Edited: 13/02/2012 10:33pm

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();


Community Member, 72 Posts

14 February 2012 at 7:18am

Edited: 14/02/2012 7:38am

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

Go to Top