Skip to content

shopperplus/mailtrain_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Basic Use

First create a client instance:

client = Mailtrain.new "http://xxxx.your.mailtrain.url", "your_access_token"

Subscribe / Unsubscribe

Then you can subscribe or unsubscribe from a list:

> client.subscribe list_id, "demo@demo.com", "My First Name", "My Last Name", "UTC", true
=> true
> client.unsubscribe list_id, "demo@demo.com"
=> false
> client.error
=> Invalid email address

subscribe required: list_id, email optional: first_name, last_name, timezone(default UTC), force_subscribe(default true)

unsubscribe required: list_id, email

Blacklist

To get blacklist:

> client.blacklist 0, 10000, "demo@demo.com"
=> {:total=>2, :start=>0, :limit=>10000, :emails=>["demo@demo", "test@test"]}

Add/delete email to blacklist

To get active subscriber count of a list:

> client.block email
=> true
> client.unblock email
=> true

About

Mailtrain ruby gem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages