4

I am building a transactional email platform for my users.
Users will subscribe to a digital program and receive daily emails depending on their profile and parameters.

This email sending will be:
- time based
- and user subscription based
(and not event based)

So I found these plugins:

  • Sprout Email > for marketing campaigns and email notifications triggered by events
  • Postmaster for Craft CMS > looks more promising for my need but the plugin seems not maintained anymore (last commit was two years ago)

So do you know another recent Craft plugin to do transactional emails?
Or would you recommend another approach/idea?

5

This answer will focus on using Sprout Email for transactional emails.

Transactional Emails

First, a comment on semantics. I feel the question above is drawing a distinction between two types of transactional emails: triggered and automated.

Triggered emails are a one-off, context-specific email that get sent to a user when an event is triggered by a user's interaction with the application. Automated emails, which seems to be the focus of the question, are transactional in the sense that they are a one-to-one email to a user, however the email is not triggered by a specific event, but by an automated process. A user takes an action to be placed in a specific category, and transactional emails are sent to all users in that category on a specified schedule.

Triggered emails are fairly easy to build a UI around in Craft. Automated emails are harder, as you probably have to rely on either tasks (which can't be reliably scheduled at a specific time) or cron-jobs (which require extra steps by web developers to be setup).

Sprout Email and triggered emails

While the default Sprout Email Notifications are mostly User and Entry events, Sprout Email is not at all limited to User and Entry events.

Sprout Email has a flexible Custom Event API where you can create custom triggers for the events you need to support with as many settings as you wish to control them with. An example can be seen in Sprout Forms, which adds a trigger for When a form entry is submitted.

Sprout Email allows you to manage the Triggered Email content right in Craft alongside your other content and all the admin needs to do is select the event which should trigger them being sent.

Sprout Email and automated emails

You'll have to create a custom script and setup a cron to ping your script to send out emails on the schedule you require, but Sprout Email can support (and is in use for) advanced transactional campaigns that allow content editors to easily manage email content in a Craft-friendly way, and programmatically send out transactional email on a regular schedule.

You can programmatically trigger a Notification Email using the Sprout Email service layer. Notification Emails are sent via the SproutEmail_DefaultMailerService using the sendNotification() method:

craft()->sproutEmail_defaultMailer->sendNotification($campaign, $object);
  • $campaign needs to be a SproutEmail_CampaignModel
  • $object is any object that you want to make available to your email templates.

At some point we'll probably add additional support in Sprout Email around dynamic list management and automated emails. Right now, it's quite possible, it just requires a custom integration that fits your needs.

| improve this answer | |
  • Amazing answer! Thanks you Ben. You are right, I was first struggling to express clearly my needs :) I will correct my question for what I say about Sprout Email :) – migswd Aug 4 '16 at 19:30
  • OK I am going to play more with Sprout Email to try to do my automated emails as you explain with cron job. Would you recommend this plugin for cron job tasks https://github.com/boboldehampsink/cronjob ? Thx. – migswd Aug 4 '16 at 19:43
  • 1
    I haven't used that plugin so can't speak to it. Cron jobs are fairly simple to setup directly on your server too, but the syntax can be a bit confusing and they typically require a certain level of permissions to create. Generally, once you set them up you hardly ever need to change them. You'll probably just need it to ping a custom controller you create that kicks off all of your transactional email logic. – Ben Parizek Aug 4 '16 at 20:35
  • Ben just want to precise what you say here : Right now, it's quite possible, it just requires a custom integration that fits your needs. You mean it is possible to do automated emails (send emails at specific hours) with Sprout Email and without need of a cron job ?! – migswd Aug 6 '16 at 7:33
  • Right now, to send automated emails at specific a hours with Sprout Email you will need to setup a cron job, and have that cron job ping a custom controller that handles the logic of your situation. Sprout Email can help simplify several parts around managing the emails, but does not yet have support for setting up automated emails without additional customization. – Ben Parizek Aug 6 '16 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.