Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Send email button

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

Page: 1
Go to End
Author Topic: 1010 Views
  • Mo
    Avatar
    Community Member
    504 Posts

    Send email button Link to this post

    Hi All,

    Couple of quick questions. I would like to add a send email button for certain templates in the CMS. How would I go about doing this, and adding recipients for that email? I have looked at http://doc.silverstripe.org/doku.php?id=email but it doesn't really g into that sort of detail.

    Also, how could I send images linked to that page via a $has_one as attachments? Can I literally do a Dataobject::get() and load the result into a parameter?

    Cheers in advance,

    Mo

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: Send email button Link to this post

    You should be able to do this with one or more custom email templates.
    Link the button to an action on your controller that sets up the template and the email.

    You can send custom variables to the template so I think you can get an image in that way.
    Use $email->populateTemplate(Your stuff here); to send the content you want to the email template.

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