It's all about the answers!

Ask a question

RAM: How to send an email from within a custom policy


Angela Borchard (701220) | asked Apr 29 '13, 2:47 a.m.

Hello,

Is there a way to send an email from within a custom RAM policy?

I need to send an email to certain users as soon as a custom policy passes.

Thanks!

One answer



permanent link
Gili Mendel (1.8k56) | answered Apr 29 '13, 9:02 a.m.
JAZZ DEVELOPER
You can always extend the com.ibm.ram.repository.policy.SendEmailPolicy
The following is its main test() code - figure out who do you want to send to, and the sendMail() call.

It should be in the com.ibm.ram.repository.jar in the WEB-INF/lib of the war.
try {                        
Letter.Recipients recipients =
    this.getNotifyList(shouldEmailcollaborators, shouldEmailManagers, shouldEmailOwners, shouldEmailPendingReviewers, emailTo);                      

sendMail(recipients, subject, body);     
             
} catch (AssetNotFoundException e) {










Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.