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.
Add this line to your application's Gemfile:
gem 'yonoma'Then execute:
bundle installOr install it yourself as:
gem install yonomaTo configure the SDK, initialize it with your API key:
require 'yonoma'
Yonoma.api_key = 'api_key'response_email = Yonoma::Email.send({
"from_email":"updates@yonoma.io",
"to_email":"email@yourdomain.com",
"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_emailresponse_contact = Yonoma::Contacts.create("List Id", {
"email" : "email@example.com",
"status": "Subscribed" | "Unsubscribed"
"firstName": string, //optional
"lastName": string, //optional
"phone": string, //optional
"gender": string, //optional
"address": string, //optional
"city": string, //optional
"state": string, //optional
"country": string, //optional
"zipcode": string, //optional
})
puts response_contactresponse_contact = Yonoma::Contacts.unsubscribe("List Id", "Contact Id", {
"status" : "Subscribed" | "Unsubscribed"
})
puts response_contactresponse_add_tag = Yonoma::Contacts.addTag("Contact Id", {
"tag_id" : "Tag Id"
})
puts response_add_tagresponse_remove_tag = Yonoma::Contacts.removeTag("Contact Id", {
"tag_id" : "Tag Id"
})
puts response_remove_tagresponse_add_tag = Yonoma::Tags.create({
"tag_name" : "Tag Name"
})
puts response_add_tagresponse_update_tag = Yonoma::Tags.update("Tag Id", {
"tag_name" : "Tag Name"
})
puts response_update_tagresponse_del_tag = Yonoma::Tags.delete("Tag Id")
puts response_del_tagresponse_tags_retrieve = Yonoma::Tags.retrieve("Tag Id")
puts response_tags_retrieveresponse_tags = Yonoma::Tags.list()
puts response_tagsresponse_add_list = Yonoma::Lists.create({
"list_name" : "List Name"
})
puts response_add_listresponse_update_list = Yonoma::Lists.update("List Id", {
"list_name" : "List Name"
})
puts response_update_listresponse_del_list = Yonoma::Lists.delete("List Id")
puts response_del_listresponse_list_retrieve = Yonoma::Lists.retrieve("List Id")
puts response_list_retrieveresponse_list = Yonoma::Lists.list()
puts response_list