mailersend-ruby 1.5.2 → 1.6.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: 6346fa18c1ea9c31c279efee9ad04e00ea9aefbf9404cb809e7b4d03a4a68b39
4
- data.tar.gz: ba5a053236908bcf7ddef6d96361637d7939dd0cbeff5064ce6ec99a080b3135
3
+ metadata.gz: 51974d7d8584e99e7d3913249f949e05e5aacbc8db3732b166a16baf7b8313dd
4
+ data.tar.gz: 7634d9b0a6a9463961e425b1c67c8a5df2668dd202c06a2eee043201be42ec38
5
5
  SHA512:
6
- metadata.gz: aca1d6309de48cd46627023d6d17382349ace946b28d1b01b934b5d1806259c2ab0992ceaee4483b09fe6da70c601ef8b08683b7a0d066a2298eae7a0ef03e70
7
- data.tar.gz: fe44c8e8a2563eaf6864c18284c8714feb68677c2fe666b6d1c03ed8a7a00441afab6a01301532fb184487661d15783e7d87ae0757f14be6eb80f4bdc3a1a712
6
+ metadata.gz: 2fb335aa0e07bfb4836571f956abc8d0505e1f397ca003da6792fc488a9bbfd3bd71c6578a338ceb49920bd72e4baf58b0eed70d8bca4e07c3aeb23cb216b74b
7
+ data.tar.gz: 16c0baec523c402acb12b54a9217d052e5e2104a975a781a803cfe392b737bd9b1e016ce807f3387eab243139bcade197e9b8a6b53ffe390162f8d004c96170f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Released]
2
2
 
3
+ ## [1.6.0] - 2023-06-22
4
+
5
+ - Sender identities by email
6
+
7
+ ## [1.5.2] - 2023-06-20
8
+
9
+ - Removed uninitialized variable
10
+
3
11
  ## [1.5.1] - 2023-05-09
4
12
 
5
13
  - Added supports for base64 attachment
data/README.md CHANGED
@@ -37,6 +37,7 @@ MailerSend Ruby SDK
37
37
  - [Domains](#domains)
38
38
  - [Get a list of domains](#get-a-list-of-domains)
39
39
  - [Get a single domain](#get-a-single-domain)
40
+ - [Add a domain](#add-a-domain)
40
41
  - [Delete a domain](#delete-a-domain)
41
42
  - [Get recipients for a domain](#get-recipients-for-a-domain)
42
43
  - [Update domain settings](#update-domain-settings)
@@ -45,9 +46,12 @@ MailerSend Ruby SDK
45
46
  - [Sender Identities](#sender-identities)
46
47
  - [Get a list of sender identities](#get-a-list-of-sender-identities)
47
48
  - [Get a single sender identity](#get-a-single-sender-identity)
49
+ - [Get a single sender identity by email](#get-a-single-sender-identity-by-email)
48
50
  - [Add a sender identity](#add-a-sender-identity)
49
51
  - [Update a sender identity](#update-a-sender-identity)
52
+ - [Update a sender identity by email](#update-a-sender-identity-by-email)
50
53
  - [Delete a sender identity](#delete-a-sender-identity)
54
+ - [Delete a sender identity by email](#delete-a-sender-identity-by-email)
51
55
  - [Messages](#messages)
52
56
  - [Get a list of messages](#get-a-list-of-messages)
53
57
  - [Get info for a single message](#get-info-for-a-single-message)
@@ -465,6 +469,15 @@ ms_domains = Mailersend::Domains.new
465
469
  ms_domains.single(domain_id: "idofdomain12412")
466
470
  ```
467
471
 
472
+ ### Add a domain
473
+
474
+ ```ruby
475
+ require "mailersend-ruby"
476
+
477
+ ms_domains = Mailersend::Domains.new
478
+ ms_domains.add(name: 'yourdomain')
479
+ ```
480
+
468
481
  ### Delete a domain
469
482
 
470
483
  ```ruby
@@ -530,6 +543,15 @@ ms_sender_identity = Mailersend::SenderIdentity.new
530
543
  ms_sender_identity.single(identity_id: 'idofidentity123')
531
544
  ```
532
545
 
546
+ ### Get a single sender identity by email
547
+
548
+ ```ruby
549
+ require "mailersend-ruby"
550
+
551
+ ms_sender_identity = Mailersend::SenderIdentity.new
552
+ ms_sender_identity.single_by_email(email: 'example@email.com')
553
+ ```
554
+
533
555
  ### Add a sender identity
534
556
 
535
557
  ```ruby
@@ -548,6 +570,15 @@ ms_sender_identity = Mailersend::SenderIdentity.new
548
570
  ms_sender_identity.update(identity_id: 'idofidentity123', reply_to_email: 'replyemail', reply_to_name: 'replyname')
549
571
  ```
550
572
 
573
+ ### Update a sender identity by email
574
+
575
+ ```ruby
576
+ require "mailersend-ruby"
577
+
578
+ ms_sender_identity = Mailersend::SenderIdentity.new
579
+ ms_sender_identity.update_by_email(email: 'example@email.com', reply_to_email: 'replyemail', reply_to_name: 'replyname')
580
+ ```
581
+
551
582
  ### Delete a sender identity
552
583
 
553
584
  ```ruby
@@ -557,6 +588,15 @@ ms_sender_identity = Mailersend::SenderIdentity.new
557
588
  ms_sender_identity.delete(identity_id: 'idofidentity123')
558
589
  ```
559
590
 
591
+ ### Delete a sender identity by email
592
+
593
+ ```ruby
594
+ require "mailersend-ruby"
595
+
596
+ ms_sender_identity = Mailersend::SenderIdentity.new
597
+ ms_sender_identity.delete_by_email(email: 'example@email.com')
598
+ ```
599
+
560
600
  ## Messages
561
601
 
562
602
  ### Get a list of messages
@@ -7,6 +7,7 @@ module Mailersend
7
7
  :domain_id,
8
8
  :page,
9
9
  :limit,
10
+ :name,
10
11
  :verified
11
12
 
12
13
  def initialize(client = Mailersend::Client.new)
@@ -14,6 +15,7 @@ module Mailersend
14
15
  @domain_id = domain_id
15
16
  @page = page
16
17
  @limit = limit
18
+ @name = name
17
19
  @verified = verified
18
20
  end
19
21
 
@@ -37,6 +39,16 @@ module Mailersend
37
39
  query: URI.encode_www_form(hash.compact)))
38
40
  end
39
41
 
42
+ def add(name: nil, return_path_subdomain: nil, custom_tracking_subdomain: nil, inbound_routing_subdomain: nil)
43
+ hash = {
44
+ 'name' => name,
45
+ 'return_path_subdomain' => return_path_subdomain,
46
+ 'custom_tracking_subdomain' => custom_tracking_subdomain,
47
+ 'inbound_routing_subdomain' => inbound_routing_subdomain
48
+ }
49
+ client.http.post("#{API_URL}/domains", json: hash.compact)
50
+ end
51
+
40
52
  def delete(domain_id:)
41
53
  client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}"))
42
54
  end
@@ -50,7 +62,7 @@ module Mailersend
50
62
  query: URI.encode_www_form(hash.compact)))
51
63
  end
52
64
 
53
- def settings(domain_id:, send_paused: nil, track_clicks: nil, track_opens: nil, track_unsubscribe: nil, track_unsubscribe_html: nil, track_unsubscribe_plain: nil, track_content: nil, custom_tracking_enabled: nil, custom_tracking_subdomain: nil)
65
+ def settings(domain_id:, send_paused: nil, track_clicks: nil, track_opens: nil, track_unsubscribe: nil, track_unsubscribe_html: nil, track_unsubscribe_plain: nil, track_content: nil, custom_tracking_enabled: nil, custom_tracking_subdomain: nil, precedence_bulk: nil)
54
66
  hash = {
55
67
  'send_paused' => send_paused,
56
68
  'track_clicks' => track_clicks,
@@ -60,7 +72,8 @@ module Mailersend
60
72
  'track_unsubscribe_plain' => track_unsubscribe_plain,
61
73
  'track_content' => track_content,
62
74
  'custom_tracking_enabled' => custom_tracking_enabled,
63
- 'custom_tracking_subdomain' => custom_tracking_subdomain
75
+ 'custom_tracking_subdomain' => custom_tracking_subdomain,
76
+ 'precedence_bulk' => precedence_bulk
64
77
  }
65
78
  client.http.put("#{API_URL}/domains/#{domain_id}/settings", json: hash.compact)
66
79
  end
@@ -6,6 +6,7 @@ module Mailersend
6
6
  attr_accessor :client,
7
7
  :domain_id,
8
8
  :identity_id,
9
+ :email,
9
10
  :page,
10
11
  :limit
11
12
 
@@ -13,6 +14,7 @@ module Mailersend
13
14
  @client = client
14
15
  @domain_id = domain_id
15
16
  @identity_id = identity_id
17
+ @email = email
16
18
  @page = page
17
19
  @limit = limit
18
20
  end
@@ -35,6 +37,14 @@ module Mailersend
35
37
  query: URI.encode_www_form(hash.compact)))
36
38
  end
37
39
 
40
+ def single_by_email(email:)
41
+ hash = {
42
+ 'email' => email
43
+ }
44
+ client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/email/#{email}",
45
+ query: URI.encode_www_form(hash.compact)))
46
+ end
47
+
38
48
  def add(domain_id: nil, name: nil, email: nil, reply_to_email: nil, reply_to_name: nil, add_note: nil, personal_note: nil)
39
49
  hash = {
40
50
  'domain_id' => domain_id,
@@ -61,8 +71,25 @@ module Mailersend
61
71
  client.http.put("#{API_URL}/identities/#{identity_id}", json: hash.compact)
62
72
  end
63
73
 
74
+ def update_by_email(email:, domain_id: nil, name: nil, reply_to_email: nil, reply_to_name: nil, add_note: nil, personal_note: nil)
75
+ hash = {
76
+ 'domain_id' => domain_id,
77
+ 'name' => name,
78
+ 'email' => email,
79
+ 'reply_to_email' => reply_to_email,
80
+ 'reply_to_name' => reply_to_name,
81
+ 'add_note' => add_note,
82
+ 'personal_note' => personal_note
83
+ }
84
+ client.http.put("#{API_URL}/identities/email/#{email}", json: hash.compact)
85
+ end
86
+
64
87
  def delete(identity_id:)
65
88
  client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
66
89
  end
90
+
91
+ def delete_by_email(email:)
92
+ client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/email/#{email}"))
93
+ end
67
94
  end
68
95
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailersend
4
- VERSION = '1.5.2'
4
+ VERSION = '1.6.0'
5
5
  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.5.2
4
+ version: 1.6.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: 2023-06-20 00:00:00.000000000 Z
11
+ date: 2023-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv