cm_email 0.2.0 → 1.0.0

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: 2e256d79d8e63011d9e4e49319515a088d555d1aa8fec98a39e87bc0b21e26f1
4
- data.tar.gz: 71c082f9a539f5abe7d0f72d8dec8a3d95df6f1a933027b9bc2de8810725115d
3
+ metadata.gz: 7d9fc01afb62332198cfc51efff24b08629b18bb049d05159c3861c301c703fd
4
+ data.tar.gz: 366c302df3d2be87e2cd414e075a67840544fb0ed3f28e75d2318b7657fca652
5
5
  SHA512:
6
- metadata.gz: 74e7e574767c8da35cb208f1e221bc4175cfd511df9f18b880b3579dad6ec3b16ee6062538dc9e4b954c8f53e5e674b58dbe97b9e08cf8a687079b6d238d11c9
7
- data.tar.gz: 0f043f1007b0a78a9c9bd030f4e623f3f3d69511ca0785ca1ec3bd2f16b5221bc4910cbbe97619aae0241c5397f15c265bb1db1a5eb447a80fea009df0b4138f
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
- Cm_email.configure do |config|
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 Cm_email
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(existing_name, new_name, note = '')
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, segment_name)
63
+ def remove_segment_contact(contact_email, segment_id)
63
64
  request_body = {
64
65
  contact_email: contact_email,
65
- segment_name: segment_name
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, segment_name)
72
+ def add_segment_contact(contact_email, segment_id)
72
73
  request_body = {
73
74
  contact_email: contact_email,
74
- segment: segment_name
75
+ segment_id: segment_id
75
76
  }
76
77
  create_response = request_cm_email('/api/segments/segment_contacts/add', request_body)
77
78
  end
@@ -1,4 +1,4 @@
1
- module Cm_email
1
+ module CmEmail
2
2
  class Configuration
3
3
  attr_accessor :api_key, :api_mode
4
4
 
@@ -1,3 +1,3 @@
1
1
  module CmEmail
2
- VERSION = "0.2.0"
2
+ VERSION = "1.0.0"
3
3
  end
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.2.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 00:00:00.000000000 Z
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.1.2
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.