I built an automation to notify users when something of their interest is published
Tags: webdev, showdev, rails, startup
Published: 2020-10-09 14:12:42

---
title: I built an automation to notify users when something of their interest is published
published: true
description: I am the co-founder of Flexiple and Remote Tools. In this post, I describe why & how I built an automation on our community website to notify users on email when something of their interest is posted.
tags: webdev, showdev, rails, startup
cover_image: https://remote-tools-images.s3.amazonaws.com/automated_flow_solution.gif
canonical_url: https://www.remote.tools/remote-work-community/i-built-an-automation-to-notify-users
---
<p>I am the co-founder of <a href="https://flexiple.com">Flexiple</a> and <a href="https://remote.tools">Remote Tools</a>. In this post, I describe why & how I built an automation on our <a href="https://remoteclan.com">community website</a> to notify users on email when something of their interest is posted.</p>
<p>Here's why & how I built this.</p>
<p>Effort: Dev - 1 day, QA - 1 day.</p>
<p>Cost: None.</p>
{% twitter 1314550418857316352 %}
<h2>Business Problem</h2>
<p>We want to get users more engaged. So I tag people manually which triggers an email notification & prompts them to reply.</p>
<p>Inefficient because it relies on my memory & limit on the # of people I can tag.</p>
<p>Can I automate this?</p>
<img src="https://remote-tools-images.s3.amazonaws.com/tagging_1.png" alt="The key to successful teamwork in your remote team - team teamwork" width="100%" max-width="700px" style="border:1px solid gray;" />
<h2>Solution</h2>
<p>- Map interests against users basis profile information (one-time effort).</p>
<p>- For every story posted, mark relevant interests.</p>
<p>- If any interest for a story matches that of a user, notify the user on email.</p>
<p>- Keep the email as personalised as possible.</p>
<img src="https://remote-tools-images.s3.amazonaws.com/automated_flow_solution.gif" alt="The key to successful teamwork in your remote team - team teamwork" width="100%" max-width="700px" style="border:1px solid gray;" />
<h2>Constraints</h2>
<p>Limit # of times any user is tagged in a week</p>
<p>Randomly pick users after matching interests (for the post)</p>
<p>Limit # of people tagged on any post</p>
<p>No user to get multiple notifications for the same post</p>
<p>Remove post author & users who've already engaged</p>
<h2>Database Mapping</h2>
<p>- has_many_through association</p>
<p>- User has many interests. An interest can be mapped to multiple users.</p>
<p>- Story has many interests. An interest can be mapped to multiple stories.</p>
<h2>Map interests for users & populate DB</h2>
<p>- One-time effort to manually map interests for existing users basis their profile data. Used Google sheets for this.</p>
<p>- Wrote a simple script to transfer the data to DB.</p>
{% twitter 1314550461731467265 %}
<h2>Map interest(s) for stories (admin access only)</h2>
<p>For every relevant story, admins can map interests and that's it! Interested users are notified on email.</p>
<p>Interest mapping fields are shown only to admins & not regular users.</p>
<img src="https://remote-tools-images.s3.amazonaws.com/tagging_6.png" alt="The key to successful teamwork in your remote team - team teamwork" width="100%" max-width="700px" style="border:1px solid gray;" />
<p>I write regularly on <a href="https://twitter.com/hrishiptweets">Twitter</a> about tech, products & startups. You can <a href="https://twitter.com/hrishiptweets">connect with me there</a>.</p>