cm_email 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/cm_email.rb +9 -8
- data/lib/cm_email/configuration.rb +1 -1
- data/lib/cm_email/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d9fc01afb62332198cfc51efff24b08629b18bb049d05159c3861c301c703fd
|
4
|
+
data.tar.gz: 366c302df3d2be87e2cd414e075a67840544fb0ed3f28e75d2318b7657fca652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bfda056bc85570abe5229583aaa929f63976117dcce23d423ad2f88f63547bde56c411b7af923c690185415a075276fa1f451a04e294ee88dc44a957834cf85
|
7
|
+
data.tar.gz: 4c6038a94d86d0e76b6e3a78c71a85b9ca983eb09c6cd22609e76dc33917421a8dd7c1cdfb8cb2b5e1fcfc3e496f6b8cf64e5f959d0e78e311c3cb369cc48a72
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ To install the gem in your application:
|
|
6
6
|
```
|
7
7
|
Create a configuration file like `config/initializers/cm_email.rb`, paste the following and replace the credentials.
|
8
8
|
```
|
9
|
-
|
9
|
+
CmEmail.configure do |config|
|
10
10
|
config.api_key = "xxxxxxxxxxxxxx"
|
11
11
|
end
|
12
12
|
```
|
data/lib/cm_email.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "cm_email/version"
|
2
2
|
require 'cm_email/configuration'
|
3
3
|
|
4
|
-
module
|
4
|
+
module CmEmail
|
5
5
|
class << self
|
6
6
|
attr_accessor :configuration
|
7
7
|
require 'net/http'
|
@@ -49,29 +49,30 @@ module Cm_email
|
|
49
49
|
create_response = request_cm_email('/api/segments', request_body)
|
50
50
|
end
|
51
51
|
|
52
|
-
def update_segment(
|
52
|
+
def update_segment(new_name, note = '', segment_id = '', existing_name = '')
|
53
53
|
request_body = {
|
54
|
-
existing_name: existing_name,
|
55
54
|
new_name: new_name,
|
56
|
-
note: note
|
55
|
+
note: note,
|
56
|
+
segment_id: segment_id,
|
57
|
+
existing_name: existing_name,
|
57
58
|
}
|
58
59
|
create_response = request_cm_email('/api/segments/update', request_body)
|
59
60
|
end
|
60
61
|
|
61
62
|
# Removes contact from the segment.
|
62
|
-
def remove_segment_contact(contact_email,
|
63
|
+
def remove_segment_contact(contact_email, segment_id)
|
63
64
|
request_body = {
|
64
65
|
contact_email: contact_email,
|
65
|
-
|
66
|
+
segment_id: segment_id
|
66
67
|
}
|
67
68
|
create_response = request_cm_email('/api/segments/segment_contacts/remove', request_body, 'delete')
|
68
69
|
end
|
69
70
|
|
70
71
|
# Adds a contact to a segment.
|
71
|
-
def add_segment_contact(contact_email,
|
72
|
+
def add_segment_contact(contact_email, segment_id)
|
72
73
|
request_body = {
|
73
74
|
contact_email: contact_email,
|
74
|
-
|
75
|
+
segment_id: segment_id
|
75
76
|
}
|
76
77
|
create_response = request_cm_email('/api/segments/segment_contacts/add', request_body)
|
77
78
|
end
|
data/lib/cm_email/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cm_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PRATIK DHARAMDASANI
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem is a wrapper for Cm-email's API
|
14
14
|
email:
|
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
|
-
rubygems_version: 3.
|
47
|
+
rubygems_version: 3.0.8
|
48
48
|
signing_key:
|
49
49
|
specification_version: 4
|
50
50
|
summary: cm_email gem facilitates sending emails using Cm-email's API.
|