Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.29 KB

File metadata and controls

38 lines (25 loc) · 1.29 KB

SendGrid Event Webhook to Mixpanel Lambda Function

A simple lambda function that can be used to transfer SendGrid event data to Mixpanel pings.

Getting Started

  1. To get started, you'll need the Serverless Framework installed. You'll also need your environment configured with AWS credentials.

  2. Recommended: Map relevant Mixpanel characteristics to SendGrid SMTP API unique_args for the emails you are sending through SendGrid.

  3. Add the MIXPANEL_TOKEN env var for each environment to serverless.env.yml.

  dev:
    MIXPANEL_TOKEN: "DEV TOKEN"
  staging:
    MIXPANEL_TOKEN: "STAGING TOKEN"
  prod:
    MIXPANEL_TOKEN: "PROD TOKEN"
  1. Add your AWS credentials profile to serverless.yml.

  2. Deploy.

  sls deploy --stage prod
  1. Setup the SendGrid Event Webhook with the lambda endpoint.
  HTTP POST URL

  https://EXAMPLE.execute-api.us-east-1.amazonaws.com/dev/mixpanel_sendgrid_events
  1. 🎉 SendGrid event data is in Mixpanel and I don't have to run the webhook through our app!