Message Template Programmatic Access

Posted by Community Admin on 04-Aug-2018 21:44

Message Template Programmatic Access

All Replies

Posted by Community Admin on 12-Feb-2012 00:00

Hello,
Is it possible to access email message template content programmatically? We didn't see a specific Fluent facade for that.

As an alternative, is there a way to tell the rad editor (HtmlField) to not change the HTML we enter? We currently have a custom form for the admin to edit a simple email template, but the HtmlField seems to alter the HTML that is entered when switching between Design and HTML modes.

Thanks in advance for any help!
--
John

Posted by Community Admin on 14-Feb-2012 00:00


Hello,
Thank you for using our services. By default the ContentEditor will strip form and script tags when pasting HTML inside. One option would be to map an external template for the HtmlField template used in the ContentBlock widget designer, and in the custom template specify this.editControl.ContentFilters = Telerik.Web.UI.EditorFilters.None; For your convenience I'm attaching a sample modified template. For more information on mapping external templates to Sitefinity 4.x widgets, please check these resources:
Customizing Sitefinity 4 Controls with the ViewMap
Mapping External Templates for Sitefinity 4 Widgets

If any issues persist, can you please let us know of the exact use case scenario that you need to implement, so maybe we could provide you with a possible workaround or give you a more specific advice.


All the best,
Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 14-Feb-2012 00:00

Boyan,

Thank you for this information.

Can you also tell me how to programmatically retrieve an Email Campaign Message Template contents?

Thank you!

Posted by Community Admin on 16-Feb-2012 00:00

Bump.

Anyone know if it's possible to programmatically access an email template added in the Email Campaign | Message Templates section? How would we access these?

Thanks for any help!

Posted by Community Admin on 17-Feb-2012 00:00

Hello,

An email campaign template is actually just a MessageBody with Istemplate property set to true. So you can just say

var myMessageTemlpate = NewslettersManager.GetManager().GetMessageBodies().Where(mB => mB.IsTemplate == true && mB.Name == "MyTemplateName").FirstOrDefault();



All the best,
Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Feb-2012 00:00

Boyan,

That's great news!

Thank you very much.

Regards,
John

This thread is closed