-
1. Re: Customizing email alert message body
mazz Jun 16, 2014 2:25 PM (in response to raylite3)The alert template text file can be modified by editing this file:
<server-install-dir>/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-server.jar/alert-email-template.txt
Not sure if there is a way to inject the data you want though - what "caller principal" are you asking for? I don't think there is any user information replacement token to use.
-
2. Re: Customizing email alert message body
mazz Jun 16, 2014 2:28 PM (in response to mazz)BTW: the class that takes that template and replaces the @@@ tokens is org.rhq.enterprise.server.core.EmailManagerBean in the modules/enterprise/server/jar module - if there is some enhancement you think you can code up, create a pull request and the team can take a look.
-
3. Re: Customizing email alert message body
raylite3 Jun 16, 2014 3:25 PM (in response to mazz)Right, there isn't information about the caller principal to do the replacement. We have java standalone applications (that end users login to) making remote EJB invocations and I wanted to include information about the end user's login for troubleshooting. If I use a log event source, I can probably get this information though (for example, I can log a message saying "Call to saveXYZ by 'abc' took NNN millis" ). Can I then write my own AlertSender subclass perhaps and customize the message body?
-
4. Re: Customizing email alert message body
genman Jun 17, 2014 1:19 AM (in response to raylite3)I think for log events, the email should contain the actual log event message.
-
5. Re: Customizing email alert message body
pilhuhn Jun 17, 2014 4:20 AM (in response to raylite3)I've created a pull-request ( Allow to use an email template instead of the default. by pilhuhn · Pull Request #56 · rhq-project/rhq · GitHub ) from some changes I had hanging around on disk, which allow to use templates for the EmailSender alert sender plugin.
This does not yet cover the Subject and Roles senders.
It also does not allow to specify more stuff than what is currently available for the normal Template.
To enhance this, look at org.rhq.enterprise.server.alert.AlertManagerBean#sendAlertNotificationEmails and org.rhq.enterprise.server.core.EmailManagerBean