When a user subscribes to the newsletter they receive an email but the email is not using the SubscribeEmail.ss template. They were receiving no emails until i selected the "Send copy of submission to this address" checkbox under the Form tab of my Subscribe Form page. I think I am just missing the proper place to tell SS to send out the subscribe email and instead it using the "Send copy of submission to this address" option. Anyone had this problem. Thanks
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.
I have the same problem, and am still looking for a solution. Apparently it uses the generic email template in the user defined forms module...
So, the following code in SubscribeForm.php should send the right email (as you've probably already seen), but for some reason it doesn't do it:
$templateData = array(
'Email' => $member->Email,
'FirstName' => $member->FirstName,
'Newsletters' => new DataObjectSet( $newsletters ),
'UnsubscribeLink' => Director::baseURL() . 'unsubscribe/index/' . $member->Email
);
$email = new SubscribeForm_SubscribeEmail();
$email->setFrom( Email::getAdminEmail() );
$email->setSubject( $this->Subject );
$email->populateTemplate( $templateData );
$email->send();
Anyone?
Spent all day debugging this problem, but no worky. Nobody has this problem, really?
Ha! Solved it. Totally overlooked it, but it didn't set the To field. There's actually a patch too:
http://open.silverstripe.org/ticket/3957
Should have looked in trac. Will do so more in the future ;)
Hope this helps you too, potion_maker.