Blog

Luis Majano

June 15, 2022

Spread the word


Share your thoughts

I am very excited to announce the support for the Mailgun email delivery service in our ColdBox Mail Services module (cbmailservices) thanks to Scott Steinbeck.

What is Mailgun

Mailgun is an email delivery service for sending, receiving, and tracking emails. You can find a great introduction here: https://www.mailgun.com/blog/product/getting-started-with-mailgun-introduction-to-platform-training/

What Is 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. The supported protocols are:

  • CFMail - Traditional cfmail sending
  • File - Write emails to disk
  • InMemory - Store email mementos in an array. Perfect for testing.
  • Null - Ignores emails sent to it.
  • Postmark - Send via the PostMark API Service (https://postmarkapp.com/)
  • MailGun - Send via the MailGun API Service (https://www.mailgun.com)

It also sports tons of useful features for mail sending:

  • Async Mail
  • Mail Queues
  • Mail merging of variables
  • Mail attachments, headers and parameters
  • View and Layout+View rendering for mail
  • Mail tracking
  • Multiple mailers
  • Success and Error callbacks
  • So Much More!

You can read the full docs for our mail services here: https://coldbox-mailservices.ortusbooks.com/essentials/configuration#mail-protocols. Let's check out how nicely you can send fluent emails:

newMail( 
	to         : "email@email.com",
	from       : "no_reply@ortussolutions.com",
	subject    : "Mail Services Rock",
	type       : "html", // Can be plain, html, or text
	bodyTokens : { 
		user    : "Luis", 
		product : "ColdBox", 
		link    : event.buildLink( 'home' )
	}
)
.setBody("
    

Dear @user@,

Thank you for downloading @product@, have a great day!

@link@

") .addAttachment( expandPath( "/tmp/reports/report.pdf" ) ) .setReadReceipt( "myemail@email.com" ) .send() .onSuccess( function( result, mail ){ // Process the success }) .onError( function( result, mail ){ // Process the error });

Add Your Comment

Recent Entries

Live Stream Series - Koding with the Kiwi + Friends - July 1st 2022 Recap

Live Stream Series - Koding with the Kiwi + Friends - July 1st 2022 Recap

In our last session, Daniel and Gavin worked through a lot of content, what is the OpenAPI and Swagger Doc, some tools like editor.swagger.io and Daniel's CBSwaggerUI module. They looked at how to add tags, security, parameters, requestbody, responses and got side tracked down a really interesting rabbit hole after a question from one of the Patreons. Find out more and how to watch last weeks stream.

Gavin Pickin
Gavin Pickin
July 05, 2022
Ortus Content Digest for week of July 1st

Ortus Content Digest for week of July 1st

What has Ortus been publishing this week? We have the CFML News Podcast, more ITB Workshop Podcasts, some CFCasts and YouTube Videos, lots of Ortus and ITB Blog Posts. We have a lot more planned for next week as well

Gavin Pickin
Gavin Pickin
July 01, 2022