We are currently writing a number of Outbound Email templates. As all other templates are using the Razor Mediator, we are also using this for our templates for Outbound Email.
One of the issues we stumbled upon is how to use the specific DWT functions such as GetLinkTrackingURL() or SetEmailType(). These can easily be called from within a Dreamweaver template, but they are not available by default when you use the Razor Mediator.
We found an interesting post here : IFunctionSource functions for DWT in Razor?.
I added the functionsource assembly to the tag in my config, and added the code as specified in the response from Alex.
Unfortunately, this answer was for Tridion 2011, while i'm using Tridion 2013 SP1. When I tried to save the Razor TBB, I got the following error:
TemplateCompileException: CS1729: 'Tridion.OutboundEmail.Templating.OutboundEmailFunctionSource' does not contain a constructor that takes 0 arguments Line 26 Column 25: } public override void Execute() { * var OutboundEmail = new Tridion.OutboundEmail.Templating.OutboundEmailFunctionSource(); OutboundEmail .Initialize(TridionHelper.Engine, TridionHelper.Package);
So it looks like something changed in Tridion 2013 so this fix no longer works.