yonoma 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c456a17b6bc182674222649da8d078f1cbe9d2b3576272380ebdbcbe5fa016c4
4
- data.tar.gz: fbe633b432234503323bd4160842db7c41519750d2fc1497df863b711c608b2e
3
+ metadata.gz: 8f782eff8ed3e2b785f3a4cc1d5a83baafdcf4e25436b51404bca5054dac149a
4
+ data.tar.gz: 0ceff5124f0cc0e5e8f3dea4b7219b57f0e98c3ac2e1b10553ac89e06174ceca
5
5
  SHA512:
6
- metadata.gz: eb230d860b90c45d81d803ff66336746115d56ec39f02dd5044a63ca1ae1752d85670145c8f517ff9468f128da482cc655a8d9c3de7b8361b8d308cca8e02406
7
- data.tar.gz: 269f0296fe4e848b8459b10c8107620e569143b567d9d39766a75c5a4a3f7ef8041537f0dadb6436530b26d463272fef2dfc07fd96a5d2b7576bc3e23ac49119
6
+ metadata.gz: d1cf346c4e354af8f110e4df7afd4e33e745b7154c13986ddc59389e4c9c24ed396d1645874ad1da3b27b541ff375261d4ab1aed44bb28962bdc0af88d3a7cf7
7
+ data.tar.gz: 0bd71cbfaa5d6fb10029a0f071360b3187c226b77c9034e71b542fb8ba9bd618f3f928cb2c6f3e7a2e2060691162a29b1528398c1adbe0b9130d07147b24b9ee
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Yonoma Ruby SDK
1
+ ## [Yonoma](https://yonoma.io/) Ruby Email Marketing SDK
2
2
 
3
3
  Welcome to the Yonoma Ruby SDK! This gem provides a simple and efficient way to integrate with the Yonoma Email Marketing API.
4
4
 
@@ -29,51 +29,134 @@ To configure the SDK, initialize it with your API key:
29
29
  ```ruby
30
30
  require 'yonoma'
31
31
 
32
- Yonoma::Client.configure do |config|
33
- config.api_key = 'your_api_key_here'
34
- end
32
+ Yonoma.api_key = 'api_key'
35
33
  ```
36
34
 
37
- ## Usage
38
-
35
+ ### Usage
36
+ #### Send your email:
37
+ ```ruby
38
+ response_email = Yonoma::Mail.send({
39
+ "from_email":"updates@yonoma.io",
40
+ "to_email":"email@yourdomain.com",
41
+ "subject":"Welcome to Yonoma - You're In!",
42
+ "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."
43
+ })
44
+ puts response_email
45
+ ```
39
46
  ### Managing Contacts
40
47
 
48
+ #### Create a Contact
41
49
  ```ruby
42
- client = Yonoma::Client.new
43
- contacts = client.contacts.all
44
- client.contacts.create(email: 'test@example.com', name: 'John Doe')
50
+ response_contact = Yonoma::Contacts.create("List Id", {
51
+ "email" : "email@example.com",
52
+ "status": "Subscribed" | "Unsubscribed"
53
+ "data": {
54
+ "firstName": string,
55
+ "lastName": string,
56
+ "phone": string,
57
+ "gender": string,
58
+ "address": string,
59
+ "city": string,
60
+ "state": string,
61
+ "country": string,
62
+ "zipcode": string,
63
+ }
64
+ })
65
+ puts response_contact
45
66
  ```
46
67
 
47
- ### Managing Lists
68
+ #### Unsubscribe a Contact
69
+ ```ruby
70
+ response_contact = Yonoma::Contacts.unsubscribe("List Id", "Contact Id", {
71
+ "status" : "Subscribed" | "Unsubscribed"
72
+ })
73
+ puts response_contact
74
+ ```
48
75
 
76
+ #### Add a Tag to a Contact
49
77
  ```ruby
50
- lists = client.lists.all
51
- client.lists.create(name: 'Newsletter Subscribers')
78
+ response_add_tag = Yonoma::Contacts.add_tag("Contact Id", {
79
+ "tag_id" : "Tag Id"
80
+ })
81
+ puts response_add_tag
82
+ ```
83
+
84
+ #### Remove a Tag from a Contact
85
+ ```ruby
86
+ response_remove_tag = Yonoma::Contacts.remove_tag("Contact Id", {
87
+ "tag_id" : "Tag Id"
88
+ })
89
+ puts response_remove_tag
52
90
  ```
53
91
 
54
92
  ### Managing Tags
55
93
 
94
+ #### Create a Tag
95
+ ```ruby
96
+ response_add_tag = Yonoma::Tags.create({
97
+ "tag_name" : "Tag Name"
98
+ })
99
+ puts response_add_tag
100
+ ```
101
+
102
+ #### Update a Tag
103
+ ```ruby
104
+ response_update_tag = Yonoma::Tags.update("Tag Id", {
105
+ "tag_name" : "Tag Name"
106
+ })
107
+ puts response_update_tag
108
+ ```
109
+
110
+ #### Delete a Tag
56
111
  ```ruby
57
- tags = client.tags.all
58
- client.tags.create(name: 'VIP Customer')
112
+ response_del_tag = Yonoma::Tags.delete("Tag Id")
113
+ puts response_del_tag
59
114
  ```
60
115
 
61
- ## Development
116
+ #### Retrieve a Specific Tag
117
+ ```ruby
118
+ response_tags_retrieve = Yonoma::Tags.retrieve("Tag Id")
119
+ puts response_tags_retrieve
120
+ ```
62
121
 
63
- To contribute to the SDK:
122
+ #### List All Tags
123
+ ```ruby
124
+ response_tags = Yonoma::Tags.list()
125
+ puts response_tags
126
+ ```
64
127
 
65
- 1. Clone the repository
66
- ```sh
67
- git clone https://github.com/YonomaHQ/yonoma-email-marketing-ruby.git
68
- ```
69
- 2. Run `bin/setup` to install dependencies
70
- 3. Run `rake test` to execute tests
71
- 4. Submit a pull request with your changes
128
+ ### Managing Lists
72
129
 
73
- ## GitHub Repository
74
- Find the project on GitHub: [Yonoma Ruby SDK](https://github.com/YonomaHQ/yonoma-email-marketing-ruby)
130
+ #### Create a List
131
+ ```ruby
132
+ response_add_list = Yonoma::Lists.create({
133
+ "list_name" : "List Name"
134
+ })
135
+ puts response_add_list
136
+ ```
75
137
 
76
- ## License
138
+ #### Update a List
139
+ ```ruby
140
+ response_update_list = Yonoma::Lists.update("List Id", {
141
+ "list_name" : "List Name"
142
+ })
143
+ puts response_update_list
144
+ ```
77
145
 
78
- This project is licensed under the MIT License. See the `LICENSE` file for details.
146
+ #### Delete a List
147
+ ```ruby
148
+ response_del_list = Yonoma::Lists.delete("List Id")
149
+ puts response_del_list
150
+ ```
79
151
 
152
+ #### Retrieve a Specific List
153
+ ```ruby
154
+ response_list_retrieve = Yonoma::Lists.retrieve("List Id")
155
+ puts response_list_retrieve
156
+ ```
157
+
158
+ #### List All Lists
159
+ ```ruby
160
+ response_list = Yonoma::Lists.list()
161
+ puts response_list
162
+ ```
@@ -0,0 +1,7 @@
1
+ module Yonoma
2
+ class Mail
3
+ def self.send(params)
4
+ Client.request(:post, "/email/send", params)
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yonoma
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/yonoma.rb CHANGED
@@ -5,6 +5,7 @@ require_relative "yonoma/client"
5
5
  require_relative "yonoma/contacts"
6
6
  require_relative "yonoma/lists"
7
7
  require_relative "yonoma/tags"
8
+ require_relative "yonoma/mail"
8
9
 
9
10
  module Yonoma
10
11
  class Error < StandardError; end
data/yonoma.gemspec CHANGED
@@ -8,16 +8,15 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["YonomaHQ"]
9
9
  spec.email = ["tools@yonoma.io"]
10
10
 
11
- spec.summary = "A Ruby gem for managing and sending marketing emails."
12
- spec.description = "A Ruby gem for managing and sending marketing emails. This gem provides an easy-to-use interface to create email campaigns, handle mailing lists, and track metrics such as open rates and clicks. Ideal for small businesses and individuals who need a straightforward, code-driven solution for their email marketing needs."
11
+ spec.summary = "The official Ruby client library for the Yonoma Email Marketing API."
13
12
  spec.homepage = "https://yonoma.io/"
14
13
  spec.required_ruby_version = ">= 3.1.0"
15
14
 
16
15
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
16
 
18
17
  spec.metadata["homepage_uri"] = spec.homepage
19
- spec.metadata["source_code_uri"] = "https://github.com/YonomaHQ/yonoma-email-marketing-ruby"
20
- spec.metadata["changelog_uri"] = "https://github.com/YonomaHQ/yonoma-email-marketing-ruby/releases"
18
+ spec.metadata["source_code_uri"] = "https://github.com/YonomaHQ/yonoma-ruby"
19
+ spec.metadata["changelog_uri"] = "https://github.com/YonomaHQ/yonoma-ruby/releases"
21
20
  spec.license = "MIT"
22
21
  # Specify which files should be added to the gem when it is released.
23
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yonoma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - YonomaHQ
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-05 00:00:00.000000000 Z
10
+ date: 2025-03-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty
@@ -37,10 +37,6 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.6'
40
- description: A Ruby gem for managing and sending marketing emails. This gem provides
41
- an easy-to-use interface to create email campaigns, handle mailing lists, and track
42
- metrics such as open rates and clicks. Ideal for small businesses and individuals
43
- who need a straightforward, code-driven solution for their email marketing needs.
44
40
  email:
45
41
  - tools@yonoma.io
46
42
  executables: []
@@ -53,6 +49,7 @@ files:
53
49
  - lib/yonoma/client.rb
54
50
  - lib/yonoma/contacts.rb
55
51
  - lib/yonoma/lists.rb
52
+ - lib/yonoma/mail.rb
56
53
  - lib/yonoma/tags.rb
57
54
  - lib/yonoma/version.rb
58
55
  - yonoma.gemspec
@@ -62,8 +59,8 @@ licenses:
62
59
  metadata:
63
60
  allowed_push_host: https://rubygems.org
64
61
  homepage_uri: https://yonoma.io/
65
- source_code_uri: https://github.com/YonomaHQ/yonoma-email-marketing-ruby
66
- changelog_uri: https://github.com/YonomaHQ/yonoma-email-marketing-ruby/releases
62
+ source_code_uri: https://github.com/YonomaHQ/yonoma-ruby
63
+ changelog_uri: https://github.com/YonomaHQ/yonoma-ruby/releases
67
64
  rdoc_options: []
68
65
  require_paths:
69
66
  - lib
@@ -80,5 +77,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
77
  requirements: []
81
78
  rubygems_version: 3.6.5
82
79
  specification_version: 4
83
- summary: A Ruby gem for managing and sending marketing emails.
80
+ summary: The official Ruby client library for the Yonoma Email Marketing API.
84
81
  test_files: []