The Alerts engine calls the "processNotifications" method to retrieve alert notification content. This method is found in the email.model and sms.model under "WEB-INF/models/solutions/alerting/notifiers." The processNotifications method passes in all the necessary parameters to form the content, such as the locale, properties map, and alerts list. You can modify this method to customize the notification content.
Customizing e-mail notifications
E-mail content type
E-mail content type is defined in email.xml (WEB-INF/solutions/alerting/xml_persistence/notifier_defs). Find the property entry with the name "EMail.content.type" and modify its value.
E-mail subject
E-mail subject is defined in email.xml (WEB-INF/solutions/alerting/xml_persistence/notifier_defs). Find the property entry with the name "EMail.subject" and modify its value.
It also can be overwritten in the "processNotifications" method in email.model (WEB-INF/models/solutions/alerting/notifiers) before initializing the EMailNotifier object. See the following sample code:
//Overwrite email subject
String subject = Messages.getLocalizedString(locale, key);
if(subject != null && !subject.equals("")){
properties.put(
notifierID+"."+EMailNotifier.SUBJECT,
subject
);
}
With this technique, you can customize the subject by using resource bundles.
E-mail body
E-mail body content is defined by the "prepareContent" method in email.model (WEB-INF/models/solutions/alerting/notifiers). The default content is an HTML table created using IXml API. You can still use IXml to construct your e-mail body or you can use other means if you prefer.
Customizing SMS notifications
SMS content is defined by a helper class VSMSMailNotifier.java. The Alerts module does not provide the source code of this class. If you want to customize the SMS content, modify the method "processNotifications" of sms.model (WEB-INF/models/solutions/alerting/notifiers) to use your own content provider.