Published the source code demonstrating how to create a class to replace the default JavaxMailProgram class used to send email to users upon workflow transition. Please feel free to contribute to the example, explore branches, etc…
@see https://github.com/rileyw/PercussionWorkflowMailExample
When we created our custom mail module, we also needed to implement IPSMailMessageContext… that may be a good class to have implemented along with this (to further the example)… One of the things that we did was to go against rxworkflow.properties to get the server name (mail domain). While I did this for the implemented IPSMailMessageContext class, I did not consider using the IPSMailMessageContext.getMailDomain() in the implemented IPSMailProgram class… thanks for pointing that out!
//default fallback mailDomain
String hostNotif = "myhost.asdf.com";
try{
FileInputStream fis = new FileInputStream("rxconfig/Workflow/rxworkflow.properties");
prop.load(fis);
fis.close();
hostNotif = prop.getProperty("RX_SERVER_HOST_NOTIFICATION");
}catch (Exception e){
log.warn("Error trying to get RX_SERVER_HOST_NOTIFICATION from rxworkflow.properties: " + e);
}
msg.setFrom(new InternetAddress("no-reply@"+hostNotif));