Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Newsletter subscribeEmail.ss not being used

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 961 Views
  • potion_maker
    Avatar
    Community Member
    36 Posts

    Newsletter subscribeEmail.ss not being used Link to this post

    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

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: Newsletter subscribeEmail.ss not being used Link to this post

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

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: Newsletter subscribeEmail.ss not being used Link to this post

    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?

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: Newsletter subscribeEmail.ss not being used Link to this post

    Spent all day debugging this problem, but no worky. Nobody has this problem, really?

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: Newsletter subscribeEmail.ss not being used Link to this post

    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.

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