BoxLang 🚀 A New JVM Dynamic Language Learn More...
 
 
 
 
 Copyright Since 2005 ColdBox Platform by Luis Majano
and Ortus Solutions, Corp 
www.coldbox.org | www.ortussolutions.com
cbmailservices)Sending email doesn't have to be complicated or archaic or sad 😭.
The ColdBox Mail Services (cbmailservices) module will
allow you to send email in a fluent and abstracted way in multiple
protocols for many environments in a single cohesive API, which will
bring you smiles 😍, rainbows 🌈 and unicorns 🦄!. The supported
protocols are:
| Protocol | Description | 
|---|---|
| CFMail | Traditional sending via the mailcomponent
in the engine. | 
| File | Sends mails to a location on disk as .htmlfiles. | 
| InMemory | Store email mementos in an array. Perfect for testing. | 
| Null | Ignores emails send to it! | 
| MailGun | Sends mail via the Mailgun API Services (https://www.mailgun.com) | 
| Postmark | Send via the PostMark API Service (https://postmarkapp.com/) | 
It also sports tons of useful features for mail sending:
Mailable@cbmailservices delegate for adding mailing
traits to objects.Note: One of the features is the ability to queue emails for asynchronous (non-blocking) sending. This is done via a task runner which is on by default. This feature can be turned off, if desired, by these steps:
Open config/coldbox.cfc
In the modulesSettings section, add a key for cbmailServices with
the property runQueueTask set to false.
moduleSettings = {
	cbmailServices : {
		runQueueTask: false
	}
}
Apache License, Version 2.0.
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com
Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.
"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. And not only so, but we glory in tribulations also: knowing that tribulation worketh patience; And patience, experience; and experience, hope: And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5
"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
start:fakemail command to start FakeSMTP for testingA big thanks to @richardherbert for all the updates in this release.
temurin Java distributions from adopt due to deprecation of the service.layout arugment for the setView() method in the mail is empty, it should ignore it.Mailable@cbmailservices so you can easily add mailing capabilities to objectsbox instead of coldbox.box instead of coldbox.box.bin in the final artifact.preMailSend event to influence the mail record thanks to @gpickinvariables.config key in existence. Add reasonable defaults for commonly accessed mail fieldsrunQueueTask which is defaulted to true. If false it will not run the mail queue task in the background-snapshot left on the box.jsongetFileMimeType() so postmark attachments can work. Thanks to @garciadevCOMPATIBILITY : Settings are now using ColdBox 5 module approach of moduleSettings.cbmailservices instead of a root key element called cbmailservices. Make sure you update your settings and move them to modulesettings.cbmailservicesCOMPATIBILITY : Changed all arguments called default to defaultValue to avoid ACF issues with the parserMail object config() renamed to configure()errorArray has been renamed to just messages as it can contain warnings, information messages as well as error messagesMessageID instead of message_id now.setView() method.queue() methodsendAsync() which returns a ColdBox FuturenewMail() so you can get access to send mails easily in handlers and interceptors.log LogBox logger configured object thanks to the AbstractProtocol.name property now for a numan readable name thanks to the AbstractProtocol.Mail object now can send itself via the new send() method which delegates to the service, but provides a nice sending DSL.Mail object now has dynamic getters and setters for ALL configuration objects.CFMail, File, InMemory, Null or Postmark instead of the full path.getProperty( property, defaultValue ) method on the abstract protocol to have a default value.MailSettingsBean removed in favor of a more cohesive MailServiceprotocol setting removed in favor of multiple mailers approach and defaultProtocol usage. Please see docs.NullProtocol, InMemoryProtocol
NullProtocol ignores all calls to it.InMemoryProtocol stores mail mementos in an internal array. This can be useful for testing to check that mail was sent. It also includes a handle hasMessage method which takes a predicate callback and checks it against each sent mail. A reset method is included for use inside tests.fromName to the Mail bean to track names due to some protocols allowing itPreMailSend and PostMailSend
								$ 
									box install cbmailservices