Configuration
Let's get up and running!
Application Configuration
You can configure the module by creating a cbmailservices
key under the moduleSettings
structure in the config/Coldbox.cfc
file or the new ColdBox 7 approach of creating a config/modules/cbmailservices.cfc
Here, you will configure all the different mailers, default protocol, default sending settings, and more.
By default, the mail services are configured to send mail via the cfmail
tag using a mailer called default
.
TokenMarker
The tokenMarker
is used when doing mail merges with variables. The service will look in the body of the email and do replacements according to the following pattern:
DefaultProtocol
The name of the mailer key will be used by default to send mail. The default is called default
.
Mailers
A structure of mailer protocol registrations by key name. Each mailer is registered with the following pattern:
Defaults
A structure of default variables will be seeded into the Mail payload. The protocols then use these as defaults. For example, the CFMail
protocol will use all these as defaults to the cfmail
tag.
RunQueueTask
By default, a task runs every minute to facilitate sending emails asynchronously (non-blocking). Setting runQueueTask to false will override the default, and the task will not run.
Mail Protocols
The mail services can send mail via different protocols. The available protocol aliases you can register are:
CFMail
Null
InMemory
File
Mailgun
Postmark
Please note that some of the protocols have property requirements.
Mailer WireBox ID
You can also register ANY WireBox ID or classpath as the mailer. This will allow you to register mailers from your application or any other module.
Last updated