Skip to content

jfqd/mailtrain_ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Basic Use

First create a client instance:

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

Subscribe / Unsubscribe

Then you can subscribe or unsubscribe from a list:

> client.subscribe list_id, "[email protected]", "My First Name", "My Last Name", "UTC", false, true
=> true
> client.unsubscribe list_id, "[email protected]"
=> false
> client.error
=> Invalid email address

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

unsubscribe required: list_id, email

Blacklist

To get blacklist:

> client.blacklist 0, 10000, "[email protected]"
=> {: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

A simple ruby MailTrain API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%