Email — your friendly neighborhood Analytics reporting platform (Part 3)

Photo by Kenny Eliason on Unsplash
credits

Putting your customer first (not technology)

We have already talked a lot about the pros and cons of this approach, but let us get down to the tech stack required to get from a database to this kind of an end solution.

DATABASE WITH ABILITY TO CREATE CALCULATED KEY FIGURES

There is no question we need a database, but for the sake of speed in such an operation it is better to create data pipelines that integrate and aggregate the data at the database level (periodically throughout the day) and keep the final key figures updated and refreshed. Any database is capable of doing that, however this can be made a lot easier if the organization is using the likes of snowflake or palantir platforms.

DATA SET WITH THE KEY INFORMATION ABOUT THE EMAIL SUBSCRIBERS

An email subscription app can be built within the Django application (discussed below) and the information it captures should be at the least comprised of the following:

  • Email address
  • Key items to filter for the report: For example users might want to receive information at global or regional level — if its regional, then which countries to be included — Other filters could relate to date range or inclusion or exclusion of certain sections.
  • Frequency of emails: Hourly, daily, weekly or monthly

REST API

All modern front end applications connect to data through API — in short API are communication channels between two machines — We humans can read what is being sent to and fro but everything in there lovingly called JSON is meant for machine talk.

BACK END

I have been working with the Django web framework (which uses python as its programming language) for the past many years and it is one of the best frameworks out there to build robust web applications that can be easily scaled up.

TEMPLATES

This is the colors and tables and fonts that make up everything that is pleasing on the eyes and easier on the brains. Templates usually have placeholders which can then be connected to the new data that is being thrown in through the API.

JOINING THE DOTS

How to create a Django email is discussed here but in short, we need to:

  • Bring in the information from the email subscriptions API to know who wants what
  • Get the required numbers from each API that we configured for our calculated key figures data sets.
  • Insert these numbers into the placeholders within the email template
  • Attach the template to the email body
  • Send it out

SETTING THE FREQUENCY AND AUTOMATING

Once the application is deployed to a server, we need to automate email creation and sending. In the simplest terms, this can be done through cronjob on Linux which is usually how all applications are deployed these days. cronjob is an ideal choice to set up the time and date and frequency of running certain commands — in our case, the Django command module commands.

Photo by Gian Cescon on Unsplash

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store