Mail Events
component extends="coldbox.system.Interceptor"{
void function configure(){
}
function preMailSend( event, data, buffer, rc, prc ){
var environment = getSetting('environment');
var appName = getSetting('appName');
if(environment eq 'development'){
//change recipient if we are on development
data.mail.setTo('[email protected]');
//prefix the subject if we are on development
data.mail.setSubject('<DEV-#appName#> #data.mail.getSubject()#');
}
}
function postMailSend( event, data, buffer, rc, prc ){
if( data.result.error ){
//log mail failure here...
}
}
}preMailSend
Data Passed
Key
Type
Description
postMailSend
Data Passed
Key
Type
Description
Last updated
Was this helpful?