Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Create URI for sent Newsletters, rendering trough custom template

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: 1316 Views
  • Laax
    Avatar
    Community Member
    14 Posts

    Create URI for sent Newsletters, rendering trough custom template Link to this post

    Hi,
    I'm having trouble extending the Newsletter class and rendering the data with the custom template used to send the emails.
    Here is what I try to do:

    class MyNewsletter extends Newsletter {
    }

    class MyNewsletter_Controller extends ContentController {
    function index(){
    return $this->renderWith('VernissageEmail');
    }
    }

    I also modified the file _config.php as advised on the post Custom data fields in newsletters

    Object::useCustomClass('Newsletter', 'MyNewsletter')


    The idea would be to put a link in the email to go to a webpage if there is trouble viewing the mail.

    Hope someone can help me on this.

    Thx,
    ALex

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Create URI for sent Newsletters, rendering trough custom template Link to this post

    If all you want is a custom template, just create one in your mysite/templates/email folder. Then you can pick which template to use in the admin section from a drop down.

  • Laax
    Avatar
    Community Member
    14 Posts

    Re: Create URI for sent Newsletters, rendering trough custom template Link to this post

    Nope, I already have the template, and the newsletter is sent.
    The idea is to have a webpage that shows the newsletter in the website.
    Like a category "Sent Newsletter" in the public website, where you can find all newsletters

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