mailersend-ruby 2.0.1 → 2.0.2

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: 8d2a5a259ed13eecd19d5155d1f855449a03748539e621984630bf3ebc7a6777
4
- data.tar.gz: ad67464ced57219f06f890506ed84bd20971bf718e50ec747c8a071982cc70b8
3
+ metadata.gz: d02e47d283b821eccea2d749a54c1a06573f4e71e6139bc18d80345c02dae861
4
+ data.tar.gz: 0161ddc5936f52cc0a29e9e1bc75f0dde6f8d8b23f5d68bd2872e54b18442810
5
5
  SHA512:
6
- metadata.gz: d5f71355c8b3e35019be782a786939f5ba17a1b5af48df4e45062e767d5c0e378d2577ee80208969feb252d7024e3568a2f7dde03dc14b748441a9f7081f7335
7
- data.tar.gz: 03dab0c147d37a97bb5b61c5f02002e0e539a540f24655e1a1e4280646e42f252ccd071b0dcc54c2cab44205539b6e8268010ae4dea36b527e3c55728174b41d
6
+ metadata.gz: 0cf9a7daaf97ae809ef3213978b0121c80bff468f020a92e1ef30f3d254f950a3d75739595b21f464972ad3e171310567927cf4693ed7fb955797926888e566f
7
+ data.tar.gz: 71b65ecc6b957585a3f593cb88527459fc99b10ceff45ca32add6a395248d11254c606a29ec67f4e688c392ef52599ac4778ee9858cf47501ffcfb88dafed10c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Released]
2
2
 
3
+ ## [2.0.2] - 2024-03-12
4
+
5
+ - Update constant name
6
+
3
7
  ## [2.0.1] - 2023-01-08
4
8
 
5
9
  - Simple personalization removed
@@ -27,7 +27,7 @@ module Mailersend
27
27
  date_to: date_to
28
28
  }
29
29
 
30
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/activity/#{domain_id}",
30
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/activity/#{domain_id}",
31
31
  query: URI.encode_www_form(hash.compact)))
32
32
  end
33
33
  end
@@ -34,7 +34,7 @@ module Mailersend
34
34
  'tags[]' => tags
35
35
  }
36
36
 
37
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/date',
37
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/analytics/date',
38
38
  query: URI.encode_www_form(hash.compact)))
39
39
  end
40
40
 
@@ -47,7 +47,7 @@ module Mailersend
47
47
  'tags[]': tags
48
48
  }
49
49
 
50
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/country',
50
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/analytics/country',
51
51
  query: URI.encode_www_form(hash.compact)))
52
52
  end
53
53
 
@@ -60,7 +60,7 @@ module Mailersend
60
60
  'tags[]': tags
61
61
  }
62
62
 
63
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/ua-name',
63
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/analytics/ua-name',
64
64
  query: URI.encode_www_form(hash.compact)))
65
65
  end
66
66
 
@@ -73,7 +73,7 @@ module Mailersend
73
73
  'tags[]': tags
74
74
  }
75
75
 
76
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/ua-type',
76
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/analytics/ua-type',
77
77
  query: URI.encode_www_form(hash.compact)))
78
78
  end
79
79
  end
@@ -10,7 +10,7 @@ module Mailersend
10
10
  end
11
11
 
12
12
  def get_api_quota(*)
13
- client.http.get("#{API_URL}/api-quota")
13
+ client.http.get("#{MAILERSEND_API_URL}/api-quota")
14
14
  end
15
15
  end
16
16
  end
@@ -24,11 +24,11 @@ module Mailersend
24
24
  end
25
25
 
26
26
  def send
27
- client.http.post("#{API_URL}/bulk-email", json: @messages)
27
+ client.http.post("#{MAILERSEND_API_URL}/bulk-email", json: @messages)
28
28
  end
29
29
 
30
30
  def get_bulk_status(bulk_email_id:)
31
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/bulk-email/#{bulk_email_id}"))
31
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/bulk-email/#{bulk_email_id}"))
32
32
  end
33
33
  end
34
34
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'http'
4
4
 
5
- API_URL = 'https://api.mailersend.com/v1'
6
- API_BASE_HOST = 'api.mailersend.com'
5
+ MAILERSEND_API_URL = 'https://api.mailersend.com/v1'
6
+ MAILERSEND_API_BASE_HOST = 'api.mailersend.com'
7
7
 
8
8
  # mailersend-ruby is a gem that integrates all endpoints from MailerSend API
9
9
  module Mailersend
@@ -25,7 +25,7 @@ module Mailersend
25
25
  'limit' => limit,
26
26
  'verified' => verified
27
27
  }
28
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/domains',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/domains',
29
29
  query: URI.encode_www_form(hash.compact)))
30
30
  end
31
31
 
@@ -35,7 +35,7 @@ module Mailersend
35
35
  'limit' => limit,
36
36
  'verified' => verified
37
37
  }
38
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}",
38
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/domains/#{domain_id}",
39
39
  query: URI.encode_www_form(hash.compact)))
40
40
  end
41
41
 
@@ -46,11 +46,11 @@ module Mailersend
46
46
  'custom_tracking_subdomain' => custom_tracking_subdomain,
47
47
  'inbound_routing_subdomain' => inbound_routing_subdomain
48
48
  }
49
- client.http.post("#{API_URL}/domains", json: hash.compact)
49
+ client.http.post("#{MAILERSEND_API_URL}/domains", json: hash.compact)
50
50
  end
51
51
 
52
52
  def delete(domain_id:)
53
- client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}"))
53
+ client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/domains/#{domain_id}"))
54
54
  end
55
55
 
56
56
  def recipients(domain_id:)
@@ -58,7 +58,7 @@ module Mailersend
58
58
  'page' => page,
59
59
  'limit' => limit
60
60
  }
61
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}/recipients",
61
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/domains/#{domain_id}/recipients",
62
62
  query: URI.encode_www_form(hash.compact)))
63
63
  end
64
64
 
@@ -75,15 +75,15 @@ module Mailersend
75
75
  'custom_tracking_subdomain' => custom_tracking_subdomain,
76
76
  'precedence_bulk' => precedence_bulk
77
77
  }
78
- client.http.put("#{API_URL}/domains/#{domain_id}/settings", json: hash.compact)
78
+ client.http.put("#{MAILERSEND_API_URL}/domains/#{domain_id}/settings", json: hash.compact)
79
79
  end
80
80
 
81
81
  def dns(domain_id:)
82
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}/dns-records"))
82
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/domains/#{domain_id}/dns-records"))
83
83
  end
84
84
 
85
85
  def verify(domain_id:)
86
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/domains/#{domain_id}/verify"))
86
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/domains/#{domain_id}/verify"))
87
87
  end
88
88
  end
89
89
  end
@@ -124,7 +124,7 @@ module Mailersend
124
124
  'tags' => @tags
125
125
  }
126
126
 
127
- client.http.post("#{API_URL}/email", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
127
+ client.http.post("#{MAILERSEND_API_URL}/email", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
128
128
  end
129
129
  end
130
130
  end
@@ -19,7 +19,7 @@ module Mailersend
19
19
  hash = {
20
20
  'email' => email
21
21
  }
22
- client.http.post("#{API_URL}/email-verification/verify", json: hash.compact)
22
+ client.http.post("#{MAILERSEND_API_URL}/email-verification/verify", json: hash.compact)
23
23
  end
24
24
 
25
25
  def list(page: nil, limit: nil)
@@ -27,12 +27,12 @@ module Mailersend
27
27
  'page' => page,
28
28
  'limit' => limit
29
29
  }
30
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/email-verification',
30
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/email-verification',
31
31
  query: URI.encode_www_form(hash)))
32
32
  end
33
33
 
34
34
  def get_single_list(email_verification_id:)
35
- client.http.get("#{API_URL}/email-verification/#{email_verification_id}")
35
+ client.http.get("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}")
36
36
  end
37
37
 
38
38
  def create_a_list(name: nil, emails: nil)
@@ -40,15 +40,15 @@ module Mailersend
40
40
  'name' => name,
41
41
  'emails' => emails
42
42
  }
43
- client.http.post("#{API_URL}/email-verification", json: hash.compact)
43
+ client.http.post("#{MAILERSEND_API_URL}/email-verification", json: hash.compact)
44
44
  end
45
45
 
46
46
  def verify_a_list(email_verification_id:)
47
- client.http.get("#{API_URL}/email-verification/#{email_verification_id}/verify")
47
+ client.http.get("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}/verify")
48
48
  end
49
49
 
50
50
  def get_list_results(email_verification_id:)
51
- client.http.get("#{API_URL}/email-verification/#{email_verification_id}/results")
51
+ client.http.get("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}/results")
52
52
  end
53
53
  end
54
54
  end
@@ -20,23 +20,23 @@ module Mailersend
20
20
  end
21
21
 
22
22
  def get_inbound_routes(*)
23
- client.http.get("#{API_URL}/inbound")
23
+ client.http.get("#{MAILERSEND_API_URL}/inbound")
24
24
  end
25
25
 
26
26
  def get_single_route(inbound_id:)
27
- client.http.get("#{API_URL}/inbound/#{inbound_id}")
27
+ client.http.get("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
28
28
  end
29
29
 
30
30
  def add_inbound_route
31
- client.http.post("#{API_URL}/inbound", json: @settings)
31
+ client.http.post("#{MAILERSEND_API_URL}/inbound", json: @settings)
32
32
  end
33
33
 
34
34
  def update_inbound_route(inbound_id:)
35
- client.http.put("#{API_URL}/inbound/#{inbound_id}", json: @settings)
35
+ client.http.put("#{MAILERSEND_API_URL}/inbound/#{inbound_id}", json: @settings)
36
36
  end
37
37
 
38
38
  def delete_route(inbound_id:)
39
- client.http.delete("#{API_URL}/inbound/#{inbound_id}")
39
+ client.http.delete("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
40
40
  end
41
41
  end
42
42
  end
@@ -21,12 +21,12 @@ module Mailersend
21
21
  'limit' => limit
22
22
  }
23
23
 
24
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/messages',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/messages',
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def single(message_id:)
29
- client.http.get("#{API_URL}/messages/#{message_id}")
29
+ client.http.get("#{MAILERSEND_API_URL}/messages/#{message_id}")
30
30
  end
31
31
  end
32
32
  end
@@ -21,16 +21,16 @@ module Mailersend
21
21
  'limit' => limit
22
22
  }
23
23
 
24
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/recipients',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/recipients',
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def single(recipient_id:)
29
- client.http.get("#{API_URL}/recipients/#{recipient_id}")
29
+ client.http.get("#{MAILERSEND_API_URL}/recipients/#{recipient_id}")
30
30
  end
31
31
 
32
32
  def delete(recipient_id:)
33
- client.http.delete("#{API_URL}/recipients/#{recipient_id}")
33
+ client.http.delete("#{MAILERSEND_API_URL}/recipients/#{recipient_id}")
34
34
  end
35
35
  end
36
36
  end
@@ -20,15 +20,15 @@ module Mailersend
20
20
  end
21
21
 
22
22
  def get_list(*)
23
- client.http.get("#{API_URL}/message-schedules")
23
+ client.http.get("#{MAILERSEND_API_URL}/message-schedules")
24
24
  end
25
25
 
26
26
  def get_signle(message_id:)
27
- client.http.get("#{API_URL}/message-schedules/#{message_id}")
27
+ client.http.get("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
28
28
  end
29
29
 
30
30
  def delete(message_id:)
31
- client.http.delete("#{API_URL}/message-schedules/#{message_id}")
31
+ client.http.delete("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
32
32
  end
33
33
  end
34
34
  end
@@ -25,7 +25,7 @@ module Mailersend
25
25
  'page' => page,
26
26
  'limit' => limit
27
27
  }
28
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/identities',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/identities',
29
29
  query: URI.encode_www_form(hash.compact)))
30
30
  end
31
31
 
@@ -33,7 +33,7 @@ module Mailersend
33
33
  hash = {
34
34
  'identity_id' => identity_id
35
35
  }
36
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}",
36
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/identities/#{identity_id}",
37
37
  query: URI.encode_www_form(hash.compact)))
38
38
  end
39
39
 
@@ -41,7 +41,7 @@ module Mailersend
41
41
  hash = {
42
42
  'email' => email
43
43
  }
44
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/email/#{email}",
44
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/identities/email/#{email}",
45
45
  query: URI.encode_www_form(hash.compact)))
46
46
  end
47
47
 
@@ -55,7 +55,7 @@ module Mailersend
55
55
  'add_note' => add_note,
56
56
  'personal_note' => personal_note
57
57
  }
58
- client.http.post("#{API_URL}/identities", json: hash.compact)
58
+ client.http.post("#{MAILERSEND_API_URL}/identities", json: hash.compact)
59
59
  end
60
60
 
61
61
  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)
@@ -68,7 +68,7 @@ module Mailersend
68
68
  'add_note' => add_note,
69
69
  'personal_note' => personal_note
70
70
  }
71
- client.http.put("#{API_URL}/identities/#{identity_id}", json: hash.compact)
71
+ client.http.put("#{MAILERSEND_API_URL}/identities/#{identity_id}", json: hash.compact)
72
72
  end
73
73
 
74
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)
@@ -81,15 +81,15 @@ module Mailersend
81
81
  'add_note' => add_note,
82
82
  'personal_note' => personal_note
83
83
  }
84
- client.http.put("#{API_URL}/identities/email/#{email}", json: hash.compact)
84
+ client.http.put("#{MAILERSEND_API_URL}/identities/email/#{email}", json: hash.compact)
85
85
  end
86
86
 
87
87
  def delete(identity_id:)
88
- client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
88
+ client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
89
89
  end
90
90
 
91
91
  def delete_by_email(email:)
92
- client.http.delete(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/email/#{email}"))
92
+ client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/identities/email/#{email}"))
93
93
  end
94
94
  end
95
95
  end
@@ -41,7 +41,7 @@ module Mailersend
41
41
  'personalization' => @personalization
42
42
  }
43
43
 
44
- response = client.http.post("#{API_URL}/sms", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
44
+ response = client.http.post("#{MAILERSEND_API_URL}/sms", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
45
45
  puts response
46
46
  end
47
47
  end
@@ -19,7 +19,7 @@ module Mailersend
19
19
  'limit' => limit
20
20
  }
21
21
 
22
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-activity',
22
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-activity',
23
23
  query: URI.encode_www_form(hash)))
24
24
  end
25
25
  end
@@ -25,24 +25,24 @@ module Mailersend
25
25
  'limit' => limit
26
26
  }
27
27
 
28
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-inbounds',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-inbounds',
29
29
  query: URI.encode_www_form(hash)))
30
30
  end
31
31
 
32
32
  def get_sms_inbound_route(sms_inbound_id:)
33
- client.http.get("#{API_URL}/sms-inbounds/#{sms_inbound_id}")
33
+ client.http.get("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}")
34
34
  end
35
35
 
36
36
  def add_sms_inbound_route
37
- client.http.post("#{API_URL}/sms-inbounds", json: @settings)
37
+ client.http.post("#{MAILERSEND_API_URL}/sms-inbounds", json: @settings)
38
38
  end
39
39
 
40
40
  def update_sms_inbound_route(sms_inbound_id:)
41
- client.http.put("#{API_URL}/sms-inbounds/#{sms_inbound_id}", json: @settings)
41
+ client.http.put("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}", json: @settings)
42
42
  end
43
43
 
44
44
  def delete_sms_inbound_route(sms_inbound_id:)
45
- client.http.delete("#{API_URL}/sms-inbounds/#{sms_inbound_id}")
45
+ client.http.delete("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}")
46
46
  end
47
47
  end
48
48
  end
@@ -21,12 +21,12 @@ module Mailersend
21
21
  'limit' => limit
22
22
  }
23
23
 
24
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-messages',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-messages',
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def get(sms_message_id:)
29
- client.http.get_single_route("#{API_URL}/sms-messages/#{sms_message_id}")
29
+ client.http.get_single_route("#{MAILERSEND_API_URL}/sms-messages/#{sms_message_id}")
30
30
  end
31
31
  end
32
32
  end
@@ -23,23 +23,23 @@ module Mailersend
23
23
  'limit' => limit
24
24
  }
25
25
 
26
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-numbers',
26
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-numbers',
27
27
  query: URI.encode_www_form(hash)))
28
28
  end
29
29
 
30
30
  def get(sms_number_id:)
31
- client.http.get("#{API_URL}/sms-numbers/#{sms_number_id}")
31
+ client.http.get("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}")
32
32
  end
33
33
 
34
34
  def update(sms_number_id:, paused: nil)
35
35
  hash = {
36
36
  'paused' => paused
37
37
  }
38
- client.http.put("#{API_URL}/sms-numbers/#{sms_number_id}", json: hash.compact)
38
+ client.http.put("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}", json: hash.compact)
39
39
  end
40
40
 
41
41
  def delete(sms_number_id:)
42
- client.http.delete("#{API_URL}/sms-numbers/#{sms_number_id}")
42
+ client.http.delete("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}")
43
43
  end
44
44
  end
45
45
  end
@@ -25,19 +25,19 @@ module Mailersend
25
25
  'limit' => limit
26
26
  }
27
27
 
28
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-recipients',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-recipients',
29
29
  query: URI.encode_www_form(hash)))
30
30
  end
31
31
 
32
32
  def get(sms_recipient_id:)
33
- client.http.get("#{API_URL}/sms-recipients/#{sms_recipient_id}")
33
+ client.http.get("#{MAILERSEND_API_URL}/sms-recipients/#{sms_recipient_id}")
34
34
  end
35
35
 
36
36
  def update(sms_recipient_id:, status: nil)
37
37
  hash = {
38
38
  'status' => status
39
39
  }
40
- client.http.put("#{API_URL}/sms-recipients/#{sms_recipient_id}", json: hash.compact)
40
+ client.http.put("#{MAILERSEND_API_URL}/sms-recipients/#{sms_recipient_id}", json: hash.compact)
41
41
  end
42
42
  end
43
43
  end
@@ -21,24 +21,24 @@ module Mailersend
21
21
  hash = {
22
22
  'sms_number_id' => sms_number_id
23
23
  }
24
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/sms-webhooks',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-webhooks',
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def get_sms_webhook_route(sms_webhook_id:)
29
- client.http.get("#{API_URL}/sms-webhooks/#{sms_webhook_id}")
29
+ client.http.get("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}")
30
30
  end
31
31
 
32
32
  def add_sms_webhook_route
33
- client.http.post("#{API_URL}/sms-webhooks", json: @settings)
33
+ client.http.post("#{MAILERSEND_API_URL}/sms-webhooks", json: @settings)
34
34
  end
35
35
 
36
36
  def update_sms_webhook_route(sms_webhook_id:)
37
- client.http.put("#{API_URL}/sms-webhooks/#{sms_webhook_id}", json: @settings)
37
+ client.http.put("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}", json: @settings)
38
38
  end
39
39
 
40
40
  def delete_sms_webhook_route(sms_webhook_id:)
41
- client.http.delete("#{API_URL}/sms-webhooks/#{sms_webhook_id}")
41
+ client.http.delete("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}")
42
42
  end
43
43
  end
44
44
  end
@@ -16,19 +16,19 @@ module Mailersend
16
16
  end
17
17
 
18
18
  def get_from_blocklist(*)
19
- client.http.get("#{API_URL}/suppressions/blocklist")
19
+ client.http.get("#{MAILERSEND_API_URL}/suppressions/blocklist")
20
20
  end
21
21
 
22
22
  def get_hard_bounces(*)
23
- client.http.get("#{API_URL}/suppressions/hard-bounces")
23
+ client.http.get("#{MAILERSEND_API_URL}/suppressions/hard-bounces")
24
24
  end
25
25
 
26
26
  def get_spam_complaints(*)
27
- client.http.get("#{API_URL}/suppressions/spam-complaints")
27
+ client.http.get("#{MAILERSEND_API_URL}/suppressions/spam-complaints")
28
28
  end
29
29
 
30
30
  def get_unsubscribes(*)
31
- client.http.get("#{API_URL}/suppressions/unsubscribes")
31
+ client.http.get("#{MAILERSEND_API_URL}/suppressions/unsubscribes")
32
32
  end
33
33
 
34
34
  def add_to_blocklist(recipients: nil, patterns: nil)
@@ -36,7 +36,7 @@ module Mailersend
36
36
  'recipients' => recipients,
37
37
  'patterns' => patterns
38
38
  }
39
- client.http.post("#{API_URL}/suppressions/blocklist", json: hash.compact)
39
+ client.http.post("#{MAILERSEND_API_URL}/suppressions/blocklist", json: hash.compact)
40
40
  end
41
41
 
42
42
  def delete_from_blocklist(domain_id: nil, ids: nil, all: nil)
@@ -45,7 +45,7 @@ module Mailersend
45
45
  'ids' => ids,
46
46
  'all' => all
47
47
  }
48
- client.http.delete("#{API_URL}/suppressions/blocklist", json: hash.compact)
48
+ client.http.delete("#{MAILERSEND_API_URL}/suppressions/blocklist", json: hash.compact)
49
49
  end
50
50
 
51
51
  def add_to_hard_bounces(domain_id: nil, recipients: nil)
@@ -53,7 +53,7 @@ module Mailersend
53
53
  'domain_id' => domain_id,
54
54
  'recipients' => recipients
55
55
  }
56
- client.http.post("#{API_URL}/suppressions/hard-bounces", json: hash.compact)
56
+ client.http.post("#{MAILERSEND_API_URL}/suppressions/hard-bounces", json: hash.compact)
57
57
  end
58
58
 
59
59
  def delete_from_hard_bounces(domain_id: nil, ids: nil, all: nil)
@@ -62,7 +62,7 @@ module Mailersend
62
62
  'ids' => ids,
63
63
  'all' => all
64
64
  }
65
- client.http.delete("#{API_URL}/suppressions/hard-bounces", json: hash.compact)
65
+ client.http.delete("#{MAILERSEND_API_URL}/suppressions/hard-bounces", json: hash.compact)
66
66
  end
67
67
 
68
68
  def add_to_spam_complaints(domain_id: nil, recipients: nil)
@@ -70,7 +70,7 @@ module Mailersend
70
70
  'domain_id' => domain_id,
71
71
  'recipients' => recipients
72
72
  }
73
- client.http.post("#{API_URL}/suppressions/spam-complaints", json: hash.compact)
73
+ client.http.post("#{MAILERSEND_API_URL}/suppressions/spam-complaints", json: hash.compact)
74
74
  end
75
75
 
76
76
  def delete_from_spam_complaints(domain_id: nil, ids: nil, all: nil)
@@ -79,7 +79,7 @@ module Mailersend
79
79
  'ids' => ids,
80
80
  'all' => all
81
81
  }
82
- client.http.delete("#{API_URL}/suppressions/spam-complaints", json: hash.compact)
82
+ client.http.delete("#{MAILERSEND_API_URL}/suppressions/spam-complaints", json: hash.compact)
83
83
  end
84
84
 
85
85
  def add_to_unsubscribers(domain_id: nil, recipients: nil)
@@ -87,7 +87,7 @@ module Mailersend
87
87
  'domain_id' => domain_id,
88
88
  'recipients' => recipients
89
89
  }
90
- client.http.post("#{API_URL}/suppressions/unsubscribes", json: hash.compact)
90
+ client.http.post("#{MAILERSEND_API_URL}/suppressions/unsubscribes", json: hash.compact)
91
91
  end
92
92
 
93
93
  def delete_from_unsubscribers(domain_id: nil, ids: nil, all: nil)
@@ -96,7 +96,7 @@ module Mailersend
96
96
  'ids' => ids,
97
97
  'all' => all
98
98
  }
99
- client.http.delete("#{API_URL}/suppressions/unsubscribes", json: hash.compact)
99
+ client.http.delete("#{MAILERSEND_API_URL}/suppressions/unsubscribes", json: hash.compact)
100
100
  end
101
101
  end
102
102
  end
@@ -22,16 +22,16 @@ module Mailersend
22
22
  'limit' => limit
23
23
  }
24
24
 
25
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/templates',
25
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/templates',
26
26
  query: URI.encode_www_form(hash)))
27
27
  end
28
28
 
29
29
  def single(template_id:)
30
- client.http.get("#{API_URL}/templates/#{template_id}")
30
+ client.http.get("#{MAILERSEND_API_URL}/templates/#{template_id}")
31
31
  end
32
32
 
33
33
  def delete(template_id:)
34
- client.http.delete("#{API_URL}/templates/#{template_id}")
34
+ client.http.delete("#{MAILERSEND_API_URL}/templates/#{template_id}")
35
35
  end
36
36
  end
37
37
  end
@@ -23,18 +23,18 @@ module Mailersend
23
23
  'scopes' => scopes,
24
24
  'domain_id' => domain_id
25
25
  }
26
- client.http.post("#{API_URL}/token", json: json)
26
+ client.http.post("#{MAILERSEND_API_URL}/token", json: json)
27
27
  end
28
28
 
29
29
  def update(token_id:, status:)
30
30
  status = {
31
31
  status: status
32
32
  }
33
- client.http.put("#{API_URL}/token/#{token_id}/settings", json: status)
33
+ client.http.put("#{MAILERSEND_API_URL}/token/#{token_id}/settings", json: status)
34
34
  end
35
35
 
36
36
  def delete(token_id:)
37
- client.http.delete("#{API_URL}/token/#{token_id}")
37
+ client.http.delete("#{MAILERSEND_API_URL}/token/#{token_id}")
38
38
  end
39
39
  end
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mailersend
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
@@ -24,12 +24,12 @@ module Mailersend
24
24
  hash = {
25
25
  'domain_id' => domain_id
26
26
  }
27
- client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/webhooks',
27
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/webhooks',
28
28
  query: URI.encode_www_form(hash)))
29
29
  end
30
30
 
31
31
  def single(webhook_id:)
32
- client.http.get("#{API_URL}/webhooks/#{webhook_id}")
32
+ client.http.get("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}")
33
33
  end
34
34
 
35
35
  def create(url:, name:, events:, domain_id:, enabled: nil)
@@ -41,7 +41,7 @@ module Mailersend
41
41
  'enabled' => enabled.to_s == 'true'
42
42
  }
43
43
 
44
- client.http.post("#{API_URL}/webhooks", json: hash.compact)
44
+ client.http.post("#{MAILERSEND_API_URL}/webhooks", json: hash.compact)
45
45
  end
46
46
 
47
47
  def update(webhook_id:, url: nil, name: nil, events: nil, enabled: nil)
@@ -51,11 +51,11 @@ module Mailersend
51
51
  'events' => events,
52
52
  'enabled' => enabled.to_s == 'true'
53
53
  }
54
- client.http.put("#{API_URL}/webhooks/#{webhook_id}", json: hash.compact)
54
+ client.http.put("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}", json: hash.compact)
55
55
  end
56
56
 
57
57
  def delete(webhook_id:)
58
- client.http.delete("#{API_URL}/webhooks/#{webhook_id}")
58
+ client.http.delete("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}")
59
59
  end
60
60
  end
61
61
  end
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency 'http', '~> 5.0'
31
31
  spec.add_dependency 'json', '~> 2.5'
32
- spec.add_dependency 'uri', '~> 0.12.2'
32
+ spec.add_dependency 'uri', '~> 0.13.0'
33
33
  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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Milojević
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.12.2
47
+ version: 0.13.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.12.2
54
+ version: 0.13.0
55
55
  description: MailerSend's official Ruby SDK. Interacts with all endpoints at MailerSend
56
56
  API.
57
57
  email: