0

I'm working on a POC for an email alert tool that would be triggered by an CMS admin when a new press release is posted on their website. I've decided to try and use MailGun awesomeness to do all the heavy lifting.

Scenario: Subscribers would register on the website with Name, Email Address, Company name, and check a few options for categories (lets say: News, Product, Financial).

Admin goes into CMS, publishes press release and triggers off email alert to the subscribers that have checked one (or more) of the above categories

My question: How should I best approach the categories? Both my ideas have issues:

  1. Create separate mailing lists for each category and when an email is triggered, send to all matching lists. Problem: The subscriber will receive the same email multiple times (I hoped it it de-duplicate email addresses automatically, but it seems not to be the case)

  2. Each category is added as a custom vars against the subscribers. Problem: I cannot see a way of filtering a mailing list based on these vars. Seems that are only good for putting custom varibles in the email messages.

Other than doing all the filtering myself and sending each message one-by-one, I can't think of another way of doing it in MailGun.

1 Answers1

0

From my understanding you don't want to get down and dirty with coding and you're looking to find a way to automate this. I don't think this is possible as it requires advanced features.

This is how I would do it with coding:

  • Create the template of the email.

  • Create the content of the email in blocks: News, Product, Financial

  • Create a mailing list of addresses, with attached variables for each user that indicate interests using Mailgun's mailing list variables.

  • Iterate through each user and based on the user's interest (in the variables) append to the email the blocks of content.

  • Send the email.

If a user changes its preferences, trigger the mailing list to update the variables.

Ex:

  • Given bob@domain.com whose interests are:

interest1=news, interest2=football, interest3=animals

Send email with following text:

  • Header
  • Block1=News
  • Block2=Football
  • Block3=Animals
  • Footer

  • Given charlie@domain.com whose interests are:

interest1=cars, interest2=airplanes, interest3=blank

Send email with following text:

  • Header
  • Block1=Cars
  • Block2=Airplanes
  • Block3=(will remain blank and nothing will be appended)
  • Footer

Please do let me know if you need some help with the coding :)

API_sheriff_orlie
  • 1,223
  • 10
  • 18