dick
03/09/2022, 10:54 AMcbmailservices
as a LogBox
email appender?wil-shiftinsert
03/09/2022, 11:18 AMdick
03/09/2022, 11:23 AMwil-shiftinsert
03/09/2022, 11:24 AMvar mailservice = variables.coldbox.getWirebox().getInstance("MailService@cbmailservices");
inside your processQueueElement
method. I described how to create a custom appender and how to access coldbox here
https://shiftinsert.nl/logbox-modify-your-message-format/
Be careful with using an email appender for error logging. I have cleared some huge mailqueues several times, because people didn’t realize how many emails some errors would generate (or even errors in error handling which makes this horror recursive). In these scenario’s it would be a lot better to have some email digest which just sends all entries from the last X minutes, so you are not flooding your mailboxdick
03/09/2022, 11:27 AMwil-shiftinsert
03/09/2022, 11:31 AMI can use the regular Email Appender but was trying to reduce the number of credentials I need to keep a track of - just the API Key vs SMTP server, username, password & portYou only have to configure them once. And if you are worried about code security, you can store them in environmental variables.
dick
03/09/2022, 11:33 AMwil-shiftinsert
03/09/2022, 11:35 AMdick
03/09/2022, 11:36 AM