mailersend-ruby 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f95531e933a67ec27b789aa68008030393aceafd92f8a267ef6e69ea0684dba1
4
- data.tar.gz: 8a292cb132a367a2d654a65dd9141faae370491614b87135ec442f3d9f04983d
3
+ metadata.gz: 143a0364d9fc6022b8a7b7a246fa01ca47f6b19546334e1d54576bd3da3a774e
4
+ data.tar.gz: ddf12b66f4809ff3e015129fd2e4e0f667a9777c485243f9bac5571d0c6e421b
5
5
  SHA512:
6
- metadata.gz: 33071f4961960a37b6732ab45905e3ea2060d82080d7289e793d72dea84014f91cfe245b12a8055800a85adfebdc44b28f4a2010d71b59bb3f04dda56077450f
7
- data.tar.gz: 238d96acbe53f2d95b8326fe091baff168aef20eb7f3b64e68924fc6e53f4b5aa1620b92d88507ae151c4b5de1475cb7660403067d572b9f4769627a4b32af38
6
+ metadata.gz: 96dd151f391c1f27c51420dd4429d2175b3feca2c8fa785761c8404c86ceb4297c89f7f183d54ece3a8d73e79f1ea7b1223f809df4a92cd3949d38244960b4e2
7
+ data.tar.gz: d295d63460b934052cba1b99cd1ccbc82011499cde501f8a51ba110834c9d42606c6cbd9e1cd57c6e6a5b79e02dae338d901ecb6e92408378ef7e3efc03bd0c1
@@ -8,9 +8,9 @@ jobs:
8
8
  steps:
9
9
  - uses: actions/checkout@v3
10
10
  - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
11
+ uses: ruby/setup-ruby@v1.133.2
12
12
  with:
13
- ruby-version: 3.0.1
13
+ ruby-version: 3.0
14
14
  bundler-cache: true
15
15
  - name: Run the default task
16
16
  run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Released]
2
2
 
3
+ ## [1.4.0] - 2023-01-17
4
+
5
+ - Sender Identities
6
+
7
+ ## [1.3.2] - 2022-11-22
8
+
9
+ - Fixes add_tags method in MailerSend::Email class
10
+
3
11
  ## [1.3.1] - 2022-09-28
4
12
 
5
13
  - Added attachment content disposition
data/README.md CHANGED
@@ -42,6 +42,12 @@ MailerSend Ruby SDK
42
42
  - [Update domain settings](#update-domain-settings)
43
43
  - [Get DNS Records](#get-dns-records)
44
44
  - [Get verification status](#get-verification-status)
45
+ - [Sender Identities](#sender-identities)
46
+ - [Get a list of sender identities](#get-a-list-of-sender-identities)
47
+ - [Get a single sender identity](#get-a-single-sender-identity)
48
+ - [Add a sender identity](#add-a-sender-identity)
49
+ - [Update a sender identity](#update-a-sender-identity)
50
+ - [Delete a sender identity](#delete-a-sender-identity)
45
51
  - [Messages](#messages)
46
52
  - [Get a list of messages](#get-a-list-of-messages)
47
53
  - [Get info for a single message](#get-info-for-a-single-message)
@@ -501,6 +507,53 @@ ms_domains = Mailersend::Domains.new
501
507
  ms_domains.verify(domain_id: "idofdomain12412")
502
508
  ```
503
509
 
510
+ ## Sender Identities
511
+
512
+ ### Get a list of sender identities
513
+
514
+ ```ruby
515
+ require "mailersend-ruby"
516
+
517
+ ms_sender_identity = Mailersend::SenderIdentity.new
518
+ ms_sender_identity.list
519
+ ```
520
+
521
+ ### Get a single sender identity
522
+
523
+ ```ruby
524
+ require "mailersend-ruby"
525
+
526
+ ms_sender_identity = Mailersend::SenderIdentity.new
527
+ ms_sender_identity.single(identity_id: 'idofidentity123')
528
+ ```
529
+
530
+ ### Add a sender identity
531
+
532
+ ```ruby
533
+ require "mailersend-ruby"
534
+
535
+ ms_sender_identity = Mailersend::SenderIdentity.new
536
+ ms_sender_identity.add(domain_id: 'idofdomain12412', name: 'yourname', email: 'youremail')
537
+ ```
538
+
539
+ ### Update a sender identity
540
+
541
+ ```ruby
542
+ require "mailersend-ruby"
543
+
544
+ ms_sender_identity = Mailersend::SenderIdentity.new
545
+ ms_sender_identity.update(identity_id: 'idofidentity123', reply_to_email: 'replyemail', reply_to_name: 'replyname')
546
+ ```
547
+
548
+ ### Delete a sender identity
549
+
550
+ ```ruby
551
+ require "mailersend-ruby"
552
+
553
+ ms_sender_identity = Mailersend::SenderIdentity.new
554
+ ms_sender_identity.delete(identity_id: 'idofidentity123')
555
+ ```
556
+
504
557
  ## Messages
505
558
 
506
559
  ### Get a list of messages
@@ -114,7 +114,8 @@ module Mailersend
114
114
  'personalization' => @personalization,
115
115
  'template_id' => @template_id,
116
116
  'attachments' => @attachments,
117
- 'send_at' => @send_at
117
+ 'send_at' => @send_at,
118
+ 'tags' => @tags
118
119
  }
119
120
 
120
121
  client.http.post("#{API_URL}/email", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailersend
4
+ # SenderIdentity endpoint from MailerSend API
5
+ class SenderIdentity
6
+ attr_accessor :client,
7
+ :domain_id,
8
+ :identity_id,
9
+ :page,
10
+ :limit
11
+
12
+ def initialize(client = Mailersend::Client.new)
13
+ @client = client
14
+ @domain_id = domain_id
15
+ @identity_id = identity_id
16
+ @page = page
17
+ @limit = limit
18
+ end
19
+
20
+ def list(domain_id: nil, page: nil, limit: nil)
21
+ hash = {
22
+ 'domain_id' => domain_id,
23
+ 'page' => page,
24
+ 'limit' => limit
25
+ }
26
+ client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/identities',
27
+ query: URI.encode_www_form(hash.compact)))
28
+ puts response
29
+ end
30
+
31
+ def single(identity_id:)
32
+ hash = {
33
+ 'identity_id' => identity_id
34
+ }
35
+ client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}",
36
+ query: URI.encode_www_form(hash.compact)))
37
+ end
38
+
39
+ def add(domain_id: nil, name: nil, email: nil, reply_to_email: nil, reply_to_name: nil, add_note: nil, personal_note: nil)
40
+ hash = {
41
+ 'domain_id' => domain_id,
42
+ 'name' => name,
43
+ 'email' => email,
44
+ 'reply_to_email' => reply_to_email,
45
+ 'reply_to_name' => reply_to_name,
46
+ 'add_note' => add_note,
47
+ 'personal_note' => personal_note
48
+ }
49
+ client.http.post("#{API_URL}/identities", json: hash.compact)
50
+ end
51
+
52
+ def update(identity_id:, domain_id: nil, name: nil, email: nil, reply_to_email: nil, reply_to_name: nil, add_note: nil, personal_note: nil)
53
+ hash = {
54
+ 'domain_id' => domain_id,
55
+ 'name' => name,
56
+ 'email' => email,
57
+ 'reply_to_email' => reply_to_email,
58
+ 'reply_to_name' => reply_to_name,
59
+ 'add_note' => add_note,
60
+ 'personal_note' => personal_note
61
+ }
62
+ client.http.put("#{API_URL}/identities/#{identity_id}", json: hash.compact)
63
+ end
64
+
65
+ def delete(identity_id:)
66
+ client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
67
+ end
68
+ end
69
+ end
@@ -22,7 +22,7 @@ module Mailersend
22
22
  }
23
23
 
24
24
  client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-messages',
25
- query: URI.encode_www_form(hash)))
25
+ query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def get(sms_message_id:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailersend
4
- VERSION = '1.3.1'
4
+ VERSION = '1.4.0'
5
5
  end
data/lib/mailersend.rb CHANGED
@@ -12,6 +12,7 @@ require_relative 'mailersend/inbound_routing/inbound_routing'
12
12
  require_relative 'mailersend/messages/messages'
13
13
  require_relative 'mailersend/recipients/recipients'
14
14
  require_relative 'mailersend/scheduled_messages/scheduled_messages'
15
+ require_relative 'mailersend/sender_identity/sender_identity'
15
16
  require_relative 'mailersend/sms/sms'
16
17
  require_relative 'mailersend/sms_activity/sms_activity'
17
18
  require_relative 'mailersend/sms_messages/sms_messages'
@@ -27,11 +27,11 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.add_development_dependency 'bundler', '~> 2.3.4'
30
+ spec.add_development_dependency 'bundler', '~> 2.4.1'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
32
32
  spec.add_development_dependency 'rubocop', '~> 1.7'
33
33
  spec.add_dependency 'dotenv', '~> 2.7'
34
34
  spec.add_dependency 'http', '~> 5.0'
35
35
  spec.add_dependency 'json', '~> 2.5'
36
- spec.add_dependency 'uri', '~> 0.10.1'
36
+ spec.add_dependency 'uri', '~> 0.12.0'
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailersend-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Milojević
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-28 00:00:00.000000000 Z
11
+ date: 2023-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.4
19
+ version: 2.4.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.4
26
+ version: 2.4.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.10.1
103
+ version: 0.12.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.10.1
110
+ version: 0.12.0
111
111
  description: MailerSend's official Ruby SDK. Interacts with all endpoints at MailerSend
112
112
  API.
113
113
  email:
@@ -144,6 +144,7 @@ files:
144
144
  - lib/mailersend/messages/messages.rb
145
145
  - lib/mailersend/recipients/recipients.rb
146
146
  - lib/mailersend/scheduled_messages/scheduled_messages.rb
147
+ - lib/mailersend/sender_identity/sender_identity.rb
147
148
  - lib/mailersend/sms/sms.rb
148
149
  - lib/mailersend/sms_activity/sms_activity.rb
149
150
  - lib/mailersend/sms_inbounds/sms_inbounds.rb
@@ -182,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
183
  - !ruby/object:Gem::Version
183
184
  version: '0'
184
185
  requirements: []
185
- rubygems_version: 3.3.7
186
+ rubygems_version: 3.4.1
186
187
  signing_key:
187
188
  specification_version: 4
188
189
  summary: MailerSend's official Ruby SDK