First of all, i would like to draw your attention to this project which tries to give a better handling of Emails in C1, ie. it will also expose all your email templates as functions so you can invoke them by inserting a function and populating eventual fields necessary to generate a given email. https://bitbucket.org/burningice/compositec1contrib.email
To answer your concrete questions
To answer your concrete questions
- Calling extension methods requires that you have a using-statement for the namespace your class containing the extension methods lives in.
-
You can get the Value of any function by invoking Function("your.function.name). This will return an instance of type object, which you can then cast to the type you know that function is returning. For instance
@{
var emailSent = (bool)Function("Composite.Mail.SendMail", new { From = "...", To = "...", Subject = "...", Body = "...", IsHtml = false });
}