Forum Academy Marketplace Showcase Pricing Features

Daily Stats Email using Backend Workflow


I am trying to create a recurring (daily) email that sends me signup stats on a daily basis. We’re talking a simple daily email that says:

Hi Matthew,
Yesterday, there were X new signups to your contact list.
There are now a total of X contacts on this list.

Setting the email up is the easy part. I know how to create the emails and get the right dynamic data, but I am at a bit of a loss as to the best way to set up the backend workflow.

I imagine the trigger is a recurring event, but still can’t see how to set it up. I would like the email to send to me at the same time each day. I am sure the solution is simple.

Anyone that can tell me how it’s done?

Hey Matthew,
Here’s how to do this (I’m gonna over explain this incase anyone new is reading this and wants beginner help):

  1. Go the “Backend workflows” page of your app

  2. Create an API Workflow by clicking on “Click here to add a backend workflow…” and selecting General > New API workflow…

  3. Name the workflow whatever you want. I’ll name mine signup-email-data

  4. Now we’ll create a step to send the email. Add a step by clicking and selecting Email > Send email (there are other fancier ways to send emails but this is the built in way)

  5. Fill out your email in the To section. Then add your body message. To retrieve the total number of users that have accounts (I’m guessing that’s how you consider signups) I’m looking at created date > beginning of yesterday AND created date <= beginning of today. For the total number of users I do the same search for Users, but get rid of both filters.

  6. Next we need to schedule the workflow to happen every day. You do this by clicking to add an action, then selecting Custom Events > Schedule API Workflow.

  7. The API workflow you select is the same one you’ve created. So for this one it’ll be “signgup-email-data”. Then for scheduled date I’ve picked the current date (that you run this workflow), I round it down to the day . Then I add 1 day to make it the next day. If you want to schedule it a specific time, you could add +(hours): 6 to give it 6 more hours, putting it at 6am. Replace the 6 with the time you want.

  8. The last part is to run this workflow. We can do that by creating an extra page in our app to run workflow’s like these. I have a “develop” page for this. On the develop page, create a new button and name it something that will remind you what it does.

  9. Click on the button and select “Start/Edit Workflow”. You’ll be taken to the workflow tab, with the workflow started for this button. Add a step like before where you go to Custom Event > Schedule API Workflow. Select the API workflow we just created “signup-email-data” and put Current date/time for the “Scheduled date”.

And you’re done! You’ll need to “initialize” this workflow which is a fancy word for running the Develop page and clicking the button you created. This will run the workflow, you’ll get the email and it will schedule itself each day to send you an email the next day.

Hope this helps!

1 Like

Sensational. Thanks @bubblealex.

1 Like