Mail utils
The IMailUtils
help to manage mails.
Mail templates
Since Process2024.1.0 Process integrates an email template management system in the “Platform management” application.
A utility class allows you to manipulate these templates by calling the SDKFactory.
Bookmarks
Bookmark | Description |
---|---|
${iUser} |
The full name of the user who will receive the mail |
${link} |
The link used by the mail’s button (if the button is used) |
${directLinkLabel} |
The label used under the button to introduce the direct link |
${details} |
A custom section to display some details (usually in a grey section) |
${serverBaseURL} |
The server base URL |
${subject} |
The mail’s subject, loaded in the template |
${content} |
The mail’s content, loaded in the template |
${logo} |
The logo’s link, loaded in the template |
${primaryColor} |
The main color, loaded in the template |
${linkLabel} |
The button’s label, loaded in the template |
${footerText} |
The footer’s text, loaded in the template |
Examples
Find a template
import com.axemble.vdoc.sdk.SDKFactory;
public class MyClass {
private void myFunction() {
IResource myMailTemplate = SDKFactory.UTILS.getMailUtils().retrieveMailTemplateFromReference(myContext, "my_template_reference");
}
}
Build a mail from a template
import com.axemble.vdoc.sdk.SDKFactory;
import com.axemble.vdoc.sdk.system.mail.beans.IMailTemplate;
public class MyClass {
private void myFunction(IResource myMailTemplate) {
// Parameters to replace the bookmarks
Map<String, Object> parameters = new HashMap<>();
parameters.put("iUser", "myUserName");
IMailTemplate mailTemplate = SDKFactory.UTILS.getMailUtils().buildMailTemplate("fr", myMailTemplate, parameters);
// You can get the full email content with mailTemplate.getFullMail();
}
}