Solved

Start Email Flow From a Trigger From API

  • 9 September 2023
  • 1 reply
  • 496 views

Badge

We have a scenario in which we would like to send transactional emails based on responses from the REST API. We are offering a Trial Subscription for a Desktop Application, and our goal is to send an email when a user installs the desktop application on their PC. We have already developed an API that will provide us with the trial activation date upon installation of the application. This date will serve as a trigger to initiate the pre-configured email automation series.

The first email in the series will notify the user that they have successfully activated the trial. After a certain number of days (for example, 29 days), a reminder email will be sent, prompting the user to consider renewing their subscription. One day later, when the trial period concludes, another email will be sent to inform the user that the trial has ended.

Essentially, we would like to automate the series in advance, with the series starting when triggered by the API. If there is any alternative method to achieve this, please let us know. The desktop app operates through a REST API.

Our Desktop Application is developed in C++ while our Website is in PHP and we have created a REST API to syn users between Desktop Application and the Website.

icon

Best answer by stem 10 September 2023, 23:55

View original

1 reply

Userlevel 2
Badge +5

The simple solution:

  1. fire a custom event via the api
  2. Setup a flow that triggers off of the event which immediately sends the first email
  3. flow should have a time delay and then the second email
  4. another time delay and then the second email

I’d be sure to add a flow filter that checks to make sure the customer hasn’t already renewed their subscription. That could be identified by either another event or a profile property. Flow filters are checked before EACH email, so you only need to set that up once.

 

A case that you might want to think about, and a slightly different solution

If you already have customers in the trial before you’re launching this flow. Their trial is going to expire in less than 30 days. You could set the initial email on it’s own and trigger the reminder emails based on the expiration date:

  1. store the expiration date as a profile property
  2. trigger the flow based on X days before the expiration date
  3. time delay and then the final email

The benefit of this solution is that you can set the expiration date 2 ways:

  1. When sending the “trial start” event that triggers the first email, include the expiration date as a profile property
  2. Set the profile property independently via the API or an SFTP upload to handle

You could also handle the “customer has already renewed” case by just deleting the expiration date profile property.

Reply