BoxLang 🚀 A New JVM Dynamic Language Learn More...

ColdBox Interceptor - Environment Safe Mail Service

v1.0.1 Interceptors

Usage

Adding this intereceptor to your environments.xml.cfm file within coldbox will force coldbox to override the sending of ALL email sent through its MailService to either the 'EmailDebugTOAddress' attribute, or trace it to the coldbox dashboard.

This is the main setup I use with this interceptor

        <Interceptors>
            <!-- USE ENVIRONMENT CONTROL -->
            <Interceptor class="{location of interceptor}.EnvironmentSafeMailService">
                <Property name='EmailTrace'>true</Property>
                <Property name='EmailSend'>false</Property>
                <Property name='EmailOverrideAddress'>[email protected]</Property>
            </Interceptor>
        </Interceptors>

Attributes for Interceptor

  • EmailTrace
    • Values :
      • TRUE
        • Uses the built in logger to trace it to the dashboard
      • FALSE
        • Ignores the tracing feature
  • EmailSend
    • Values :
      • TRUE
        • Uses the EmailOverrideAddress attribute to send the email to (and removes all other recipients).
      • FALSE
        • Ignores sending the email
  • EmailOverrideAddress
    • Valid Email address to send email too.
Add interceptor xml to environments.xml.cfm file to enable.

        <Interceptors>
            <!-- USE ENVIRONMENT CONTROL -->
            <Interceptor class="{location of interceptor}.EnvironmentSafeMailService">
                <Property name='EmailTrace'>true</Property>
                <Property name='EmailSend'>false</Property>
                <Property name='EmailOverrideAddress'>[email protected]</Property>
            </Interceptor>
        </Interceptors>
Version 1.0.1
  Now accepts 3 properties at configuration to allow simultaneous tracing and sending of the email.

Version 1.0
    First release of code. 

$ box install ColdBox-Interceptor---Environment-Safe-Mail-Service

No collaborators yet.
 
  • {{ getFullDate("2010-01-19T11:38:16Z") }}
  • {{ getFullDate("2016-06-09T04:24:53Z") }}
  • 8,758
  • 4,158