Skip to content
David García edited this page Apr 28, 2016 · 3 revisions

MoonMail Links

Links handles email campaign statistics tracking

Features

Links is the service in charge of modifying the campaign body, so that statistics on email opens and clicks can be collected, and also provides endpoints to gather that data.

Dependencies

  • campaigns: it sends an SNS notification with a campaign that needs to be sent, so that the body links can be parsed.

Architecture

It’ll have four lambda functions:

  • parseLinks: it modifies the body of the campaign, appending opens tracking pixel and parsing and storing all the links data. The links URL's will be replaced by another ones that point to our API.
  • forwardLink: whenever a recipient clicks on any of the email links, he'll be directed to this function, which actually sends a SNS message to the IncrementClickCount topic and forwards the user to the actual URL.
  • incrementClickCount: increments the counter of clicks of a given link.
  • incrementOpensCount: function triggered by the opens tracking pixel, which increments the opens count.

System Messaging

This service publishes and reads messages from the following SNS topics:

  • SendCampaign
  • IncrementClickCount

SendCampaign Topic

Canonical Message

 {
  "userId": "...",
  "sender": {
    "region": "...",
    "apiKey": "...",
    "apiSecret": "...",
    "ratePerSecond": "...",
    "emailAddress": "...",
    "fromName": "..."
  },
  "campaign": {
    "id": "...",
    "body": "...",
    "subject": "...",
    "senderId": "...",
    "listIds": ["listId1", "listId2", "..." ],
    "precompiled": "true|false"
  },
  "recipientsCount": "..."
 }

Messages flow

  • parseLinks adds the pixel image for opens tracking and parses the links in the campaign body, stores them in the database and pushes a SNS message to the AttachRecipients topic. The latter message includes the parsed body and the precompiled flag is set to true.
Clone this wiki locally