Yonoma Ruby Email Marketing SDK

Welcome to the Yonoma Ruby SDK! This gem provides a simple and efficient way to integrate with the Yonoma Email Marketing API.

Installation

Add this line to your application's Gemfile:

gem 'yonoma'

Then execute:

bundle install

Or install it yourself as:

gem install yonoma

Configuration

To configure the SDK, initialize it with your API key:

require 'yonoma'

Yonoma.api_key = 'api_key'

Usage

Send your email:

response_email = Yonoma::Email.send({
    "from_email":"[email protected]",
    "to_email":"[email protected]",
    "subject":"Welcome to Yonoma - You're In!",
    "mail_template": "We're excited to welcome you to Yonoma! Your successful signup marks the beginning of what we hope will be an exceptional journey."
})
puts response_email

Managing Contacts

Create a Contact

response_contact = Yonoma::Contacts.create("List Id", {
  "email" : "[email protected]",
  "status": "Subscribed" | "Unsubscribed"
  "data": {
    "firstName": string,
    "lastName": string,
    "phone": string,
    "gender": string,
    "address": string,
    "city": string,
    "state": string,
    "country": string,
    "zipcode": string,
  }
})
puts response_contact

Unsubscribe a Contact

response_contact = Yonoma::Contacts.unsubscribe("List Id", "Contact Id", {
  "status" : "Subscribed" | "Unsubscribed"
})
puts response_contact

Add a Tag to a Contact

response_add_tag = Yonoma::Contacts.addTag("Contact Id", {
  "tag_id" : "Tag Id"
})
puts response_add_tag

Remove a Tag from a Contact

response_remove_tag = Yonoma::Contacts.removeTag("Contact Id", {
  "tag_id" : "Tag Id"
})
puts response_remove_tag

Managing Tags

Create a Tag

response_add_tag = Yonoma::Tags.create({
  "tag_name" : "Tag Name"
})
puts response_add_tag

Update a Tag

response_update_tag = Yonoma::Tags.update("Tag Id", {
  "tag_name" : "Tag Name"
})
puts response_update_tag

Delete a Tag

response_del_tag = Yonoma::Tags.delete("Tag Id")
puts response_del_tag

Retrieve a Specific Tag

response_tags_retrieve = Yonoma::Tags.retrieve("Tag Id")
puts response_tags_retrieve

List All Tags

response_tags = Yonoma::Tags.list()
puts response_tags

Managing Lists

Create a List

response_add_list = Yonoma::Lists.create({
  "list_name" : "List Name"
})
puts response_add_list

Update a List

response_update_list = Yonoma::Lists.update("List Id", {
  "list_name" : "List Name"
})
puts response_update_list

Delete a List

response_del_list = Yonoma::Lists.delete("List Id")
puts response_del_list

Retrieve a Specific List

response_list_retrieve = Yonoma::Lists.retrieve("List Id")
puts response_list_retrieve

List All Lists

response_list = Yonoma::Lists.list()
puts response_list