mailersend-ruby 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile +6 -0
- data/README.md +40 -0
- data/lib/mailersend/domains/domains.rb +15 -2
- data/lib/mailersend/sender_identity/sender_identity.rb +27 -1
- data/lib/mailersend/version.rb +1 -1
- data/mailersend-ruby.gemspec +0 -3
- metadata +5 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51974d7d8584e99e7d3913249f949e05e5aacbc8db3732b166a16baf7b8313dd
|
4
|
+
data.tar.gz: 7634d9b0a6a9463961e425b1c67c8a5df2668dd202c06a2eee043201be42ec38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb335aa0e07bfb4836571f956abc8d0505e1f397ca003da6792fc488a9bbfd3bd71c6578a338ceb49920bd72e4baf58b0eed70d8bca4e07c3aeb23cb216b74b
|
7
|
+
data.tar.gz: 16c0baec523c402acb12b54a9217d052e5e2104a975a781a803cfe392b737bd9b1e016ce807f3387eab243139bcade197e9b8a6b53ffe390162f8d004c96170f
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
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
|
@@ -25,7 +27,6 @@ module Mailersend
|
|
25
27
|
}
|
26
28
|
client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/identities',
|
27
29
|
query: URI.encode_www_form(hash.compact)))
|
28
|
-
puts response
|
29
30
|
end
|
30
31
|
|
31
32
|
def single(identity_id:)
|
@@ -36,6 +37,14 @@ module Mailersend
|
|
36
37
|
query: URI.encode_www_form(hash.compact)))
|
37
38
|
end
|
38
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
|
+
|
39
48
|
def add(domain_id: nil, name: nil, email: nil, reply_to_email: nil, reply_to_name: nil, add_note: nil, personal_note: nil)
|
40
49
|
hash = {
|
41
50
|
'domain_id' => domain_id,
|
@@ -62,8 +71,25 @@ module Mailersend
|
|
62
71
|
client.http.put("#{API_URL}/identities/#{identity_id}", json: hash.compact)
|
63
72
|
end
|
64
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
|
+
|
65
87
|
def delete(identity_id:)
|
66
88
|
client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
|
67
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
|
68
94
|
end
|
69
95
|
end
|
data/lib/mailersend/version.rb
CHANGED
data/mailersend-ruby.gemspec
CHANGED
@@ -27,9 +27,6 @@ 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.4.1'
|
31
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 1.7'
|
33
30
|
spec.add_dependency 'dotenv', '~> 2.7'
|
34
31
|
spec.add_dependency 'http', '~> 5.0'
|
35
32
|
spec.add_dependency 'json', '~> 2.5'
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailersend-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Milojević
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.1
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.4.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '13.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '13.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.7'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.7'
|
55
13
|
- !ruby/object:Gem::Dependency
|
56
14
|
name: dotenv
|
57
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,7 +127,7 @@ metadata:
|
|
169
127
|
source_code_uri: https://github.com/mailersend/mailersend-ruby
|
170
128
|
changelog_uri: https://github.com/mailersend/mailersend-ruby/blob/main/CHANGELOG.md
|
171
129
|
rubygems_mfa_required: 'true'
|
172
|
-
post_install_message:
|
130
|
+
post_install_message:
|
173
131
|
rdoc_options: []
|
174
132
|
require_paths:
|
175
133
|
- lib
|
@@ -185,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
143
|
version: '0'
|
186
144
|
requirements: []
|
187
145
|
rubygems_version: 3.4.10
|
188
|
-
signing_key:
|
146
|
+
signing_key:
|
189
147
|
specification_version: 4
|
190
148
|
summary: MailerSend's official Ruby SDK
|
191
149
|
test_files: []
|