Product

DigitalChalk leverages Mailgun for transactional email notifications

If you’ve ever taken a course online you’ve used a Learning Management System (LMS). DigitalChalk is an industry leading, multi-tenant Learning Management System serving two types of customers: corporate customers who deliver training to employees, and e-commerce customers who sell their own courses online.

PUBLISHED ON

PUBLISHED ON

This post was written and contributed by Jon Wilkinson, Software Engineer at DigitalChalk.

If you’ve ever taken a course online you’ve used a Learning Management System (LMS). DigitalChalk is an industry leading, multi-tenant Learning Management System serving two types of customers: corporate customers who deliver training to employees, and e-commerce customers who sell their own courses online.

A typical DigitalChalk customer can create events that generate email notifications such as receipt emails, user creation emails, course registration emails, course completion emails, password change emails, and many others. DigitalChalk has thousands of customers who in turn have hundreds (or thousands) of students that all receive emails in response to these various events. In short, DigitalChalk sends a lot of emails on behalf of customers.

Mailgun Integration

DigitalChalk is now integrated with Mailgun to deliver course event emails through a Mailgun account, so you’ll have all the great features that Mailgun provides. Mailing lists, marketing campaigns, analytics, and email address validation help e-commerce customers market and sell courses, while incoming mail routing, webhook integration, click tracking, and fast APIs help deliver and track corporate training. Additionally, you can now use your domain email address for your DigitalChalk email notifications instead of no-reply@digitalchalkmail.com.

Nuts and Bolts

DigitalChalk currently integrates with Mailgun using the JavaMail API over SMTP, with support for both SSL on port 465, and TLS on port 587. Connecting your two accounts simply means entering your Mailgun SMTP credentials and from-address into DigitalChalk:

We also utilize the Mailgun custom tagging feature for each outgoing email. For example, the x-mailgun-tag mail header might have a value of “USERCREATED” or “COURSECOMPLETED”. This indicates which event in DigitalChalk triggered the notification and gives you even more detail in Mailgun. Here’s how those tags might look on the Mailgun control panel:

DigitalChalk uses a dedicated notification server cluster to distribute outgoing mail. The server cluster handles the connection, protocol, and payload (html, plain text, and attachments) exchanged with Mailgun. In the unlikely event (i.e., network down) that we cannot hand off the mail to Mailgun, we make use of various retry strategies to ensure the mail is eventually delivered. One such retry strategy is the Cubed Retry Strategy. The time period between retries increases by the cube of the attempt count, with a maximum of 5 retries. The code simply calculates the next attempt time:

If DigitalChalk cannot hand off the email to Mailgun on the first attempt, we wait 8 minutes (2^3) and try again. Then we wait 27 minutes for the 3rd attempt, 64 minutes for the 4th attempt, and 125 minutes for the 5th attempt. This strategy creates a nice curve for balancing retry chattiness versus reliability.

Retry strategies greatly reduce the chances for failure, but doesn’t eliminate them. Let’s say our customer changes their Mailgun password. Ten minutes later they update it in the DigitalChalk (via the screenshot above). That leaves a ten minute window where any outgoing notifications will fail to connect to Mailgun. Luckily in this example, the cubed retry strategy will successfully connect on the 3rd attempt. However, if the customer waits 4 hours to update their password in DigitalChalk, the retry strategy will be exhausted and the notification will not be delivered. We haven’t lost the notification though, customers can see failures (and causes) within DigitalChalk:

At this point, the customer can simply click to retry the original notification, and the delivery process starts all over. We’ve avoided potential duplicate emails, increased reliability, and made failures easy to handle when they do occur.

Summary

We’re excited to be launching this new integration with Mailgun. DigitalChalk customers who use Mailgun will not only have a stronger online presence because of email branding, but will also benefit from additional Mailgun features such as mailing lists, marketing campaigns, personalization, analytics, address validation, and tracking. If you’re a DigitalChalk customer, we encourage you to signup for your Mailgun account and begin establishing your own email branding today.

Let's talk email

Learn about our deliverability services

See what you can accomplish with the world's best email delivery platform and experts at your disposal.

Click here to read more about our integration with Mailgun.

Related readings

How to improve holiday supply chain communication with email

This year, shoppers aren’t the only ones worried about orders arriving on time for the...

Read more

Create a web app from scratch in under 5 minutes with Meteor & Mailgun

This post was written by Vianney Lecroart, a Meteor earlyvangelist and captain of the Meteor Group in Paris/France. Vianney wrote his...

Read more

Together at last: Postman meets Mailgun

Mailgun has, and always will be, an email service for developers...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

Mailgun iconSee what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon Mailgun Icon