-
Notifications
You must be signed in to change notification settings - Fork 0
Mails (EN)
mekor-dev edited this page Sep 29, 2020
·
2 revisions
The platform send mail automatically by SMTP. The MailMessage system allow to customise the mail for a given recipient.
Important classes:
-
MailType: A type of mail to send -
MailMessage: Store the message of a MailType for each locale. The message has parameters that the platform must replace. -
MailService: Manage mails (configuration / building / sending)
For each type of mail to send, the MailMessage class defines a message for each locale
For MailMessage, the MailMessageHTML table must be filled with HTML message of each locale
The message can contains parameters that will be replaced when building the mail. Parameters are surrounded by {}. Exemple: Hi {userName}, you account has been created !
Map<MailParam, String> params = new HashMap<>();
params.put(MailParam.USERNAME, user.getNickname());
sendMail(MailType.FORGOTTEN_PASSWORD, user, requestLocale, params);