Coder Social home page Coder Social logo

shotstack / christmas-2019-personalised-email Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 3.0 59 KB

A sample script we used to prepare and send 300 personalised videos to our Mailchimp subscribers

JavaScript 100.00%
video mailchimp email-marketing personalisation

christmas-2019-personalised-email's Introduction

Personalised Christmas Video Example

This example loops through a list of contacts and creates a personalised video using the Shotstack API. It creates a mailing list with the video filename ready for mail merging in an application like Mailchimp.

Requirements

  • NodeJS >= 8
  • A shotstack API key and Customer ID

You can sign up for an API key via our website.

This guide assumes a Linux base operating system is being used.

Installation

Install dependencies:

npm install

Setup

Rename the .env.dist file and populate with your API key and customer ID.

mv .env.dist .env

Rename user-list.dist.csv or create a user-list.csv with a list of users to create personalised videos for including their email address and first name.

mv user-list.dist.csv user-list.csv

Usage

Once your list is prepared run the queue.js script to personalise the template and POST the edit to the Shotstack API:

npm run queue

The script will limit the number of videos that can be queued at one time to a maximum of 20, to work through a mailing list you should set a --skip argument to skip through records in the CSV file and you can override the default number of records to queue using the --limit argument.

To skip the first 20 records and queue the next 20:

npm run queue -- --skip 20

To skip the first 40 records and queue the next 10:

npm run queue -- --skip 40 --limit 10

As videos are queued the users name, email, video file name and a preview URL will be written to mailing-list.csv which can be used in a mail merge email service like Mailchimp.

You can also view the videos once they are rendered using the preview URL written to the file.

Notes:

  • This is an example only, using this on large lists will quickly be throttled and rate limited. You should build your own batching and throttling if you wish to use this at scale.
  • It can take a few minutes for videos to render and be available for previewing.
  • Videos should be transfered to your own video hosting provider or S3 bucket before sedning to customers. The preivew URL will expire after 24 hours and the video will be deleted.

christmas-2019-personalised-email's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.