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

Customising the CMS /

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

Send email button


Go to End


2 Posts   1640 Views

Avatar
Mo

Community Member, 541 Posts

28 August 2009 at 9:48pm

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

Avatar
MarcusDalgren

Community Member, 288 Posts

29 August 2009 at 2:21am

Edited: 29/08/2009 2:23am

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.