[coldbox 3.8.1] EnvironmentSafeMailService Interceptor

Hi,

I am tying to get the Environment Save Mail Service Interceptor by Craig Benner working in my app (http://www.coldbox.org/forgebox/view/ColdBox-Interceptor---Environment-Safe-Mail-Service).

It is loaded, but emails are still being sent to the original email address rather than the override address.

Emails should go to my@overrideemail.com, but they are still going to my@originalemail.com

Can anyone tell me what I might be missing?

Thanks!

Interceptor Declaration in config/Coldbox.cfc.

`

//Register interceptors as an array, we need order

interceptors = [

{class=“coldbox.system.interceptors.SES”, properties={}},

{class=“model.cmsService”},

{class=“interceptors.formParser”},

{class=“interceptors.EnvironmentSafeMailService”, properties={ emailTrace=false, emailSend=true, EmailOverrideAddress="my@overrideemail.com" }}

];

`

Sending the email with the mailservice

`

var email = mailService.newMail(

to = “my@originalemail.com”,

from = rc.signature.getEmailAddress(),

subject=“Membership Renewal”,

type = “html”

);

email.addMailPart(charset=‘utf-8’,type=‘text/plain’,body=renderLayout(“email/signatureEmail”));

email.addMailPart(charset=‘utf-8’,type=‘text/html’,body=renderLayout(“email/signatureEmail”));

sentEmail = mailService.send(email);

`

This Interceptor doesn’t work for me either.

After taking a very quick look, it appears to rely on deprecated functionality. The MethodInjector plugin doesn’t seem to exist anymore. Also, i don’t think it will ever be able to intercept the mail service send.

Might be time for a version 2, any pointers from the community?

Many Thanks,

Alex

extend the mail plugin to suite your needs. you can detect environment settings there.

you could even write a module with its own interceptors.