MailService
moduleSettings.cbmailservices
in the config/coldbox.cfc
configuration file instead of the top level mailServices
struct.mailServices
struct. Now you will use the defaults
struct instead.protocol
struct is now removed. You will have to register the protocol by name in the mailers
struct and add a defaultProtocol
key which points to the one you define in the mailers.defaultProtocol
is added and no mailers
then the mail services module will register a cfmail
protocol for you as the default
mailer.error
and errorArray
would be returned from the send()
method. Now, the Mail
bean is returned (whether using mail.send()
or mailService.send( mail )
). The previously available struct can be accessed using mail.getResults()
. (Be sure to see the changes to the errorArray
name below.)errorArray
errorArray
has been renamed to messages
. Which is still an array but can be used by any protocol to register an array of messages about the mailing for any status.config()
method was renamed to configure()
message_id
renamed to messageId
message_id
to messageID
to be consistent with the postmark API results.newMail()
in any handler, and interceptor to start a fluent mailing.name
property that can be used to give a human readable name for all protocols.config
structure. This structure is used to model all the mail settings and properties that will be used to send mail through any protocol.send()
method will return itself so you can interact with the payload for either success or failures. You will do so using the following methods:OnError( callback )
OnSuccess ( callback )
getResults()
: struct. Empty if no resultshasErrors()
: boolean. False if no resultsgetResultMessages()
: array. Empty if no resultsmailers
structure where you can register extra named mailer protocols. You can then use them by name in your mail payloads and set the defaultProtocol
as well by it's name.setMailer()
method to register the name of the mailer to use for the payload or use the mailer
configuration key.setView()
method.args
into the view and layout as the body
of the mailing. If you don't pass a layout
by convention we will just render the view in isolation.queue()
method. That’s it. The mail services schedule will deliver the mail payload to the right mailer asynchronously and at least every minute schedule.queue()
method is a task ID guid which you can use to track in log statements.