The alert template text file can be modified by editing this file:
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.
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.
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?
I think for log events, the email should contain the actual log event message.
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