Skip to content

nylas-samples/mail_merge_ruby

Repository files navigation

Mail Merge Template

This project will show you how to create a Mail Merge Template using Ruby and Sinatra.

Setup

System dependencies

  • Ruby 3.1.1 or greater

Gather environment variables

You'll need the following values:

CLIENT_ID = ""
CLIENT_SECRET = ""
ACCESS_TOKEN = ""

Add the above values to a new .env file:

$ touch .env # Then add your env variables

Install dependencies

$ gem install dotenv
$ gem install sinatra
$ gem install sinatra-flash
$ gem install nylas
$ gem install webrick

Usage

Clone the repository. Go to your terminal and type:

$ ruby MailMerge.rb

Create an .csv file with information like this:

Name | Last_Name | Account | Address | Email | Gift

The only "mandatory" fields are: Name and Email. You can delete, update or create new fields.

And go to http://localhost:4567

You will presented with a form, enter the Subject, Body and select the .csv file that you're going to use and simply press submit to start sending personlized emails.

Read the blog post

About

Mail Merge Template using Ruby

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published