mailersend-ruby 3.5.0 → 3.6.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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/fixtures/account/account_get.yml +1 -1
  4. data/fixtures/account/account_get_without_whatsapp.yml +1 -1
  5. data/fixtures/activity/activity_get_activity.yml +1 -1
  6. data/fixtures/api_quota/api_quota_get.yml +1 -1
  7. data/fixtures/bulk_email/bulk_email_send.yml +1 -1
  8. data/fixtures/bulk_email/bulk_email_status.yml +1 -1
  9. data/fixtures/dmarc_monitoring/add_favorite.yml +1 -1
  10. data/fixtures/dmarc_monitoring/create.yml +1 -1
  11. data/fixtures/dmarc_monitoring/delete.yml +1 -1
  12. data/fixtures/dmarc_monitoring/list.yml +1 -1
  13. data/fixtures/dmarc_monitoring/remove_favorite.yml +1 -1
  14. data/fixtures/dmarc_monitoring/report.yml +1 -1
  15. data/fixtures/dmarc_monitoring/report_by_ip.yml +1 -1
  16. data/fixtures/dmarc_monitoring/report_sources.yml +1 -1
  17. data/fixtures/dmarc_monitoring/update.yml +1 -1
  18. data/fixtures/domains/domains_add.yml +1 -1
  19. data/fixtures/domains/domains_delete.yml +1 -1
  20. data/fixtures/domains/domains_dns.yml +1 -1
  21. data/fixtures/domains/domains_list.yml +1 -1
  22. data/fixtures/domains/domains_recipients.yml +1 -1
  23. data/fixtures/domains/domains_settings.yml +1 -1
  24. data/fixtures/domains/domains_single.yml +1 -1
  25. data/fixtures/domains/domains_verify.yml +1 -1
  26. data/fixtures/email/email_send.yml +1 -1
  27. data/fixtures/email/email_send_template_language.yml +1 -1
  28. data/fixtures/emails/emails_list_emails.yml +1 -1
  29. data/fixtures/emails/emails_list_emails_empty_page.yml +1 -1
  30. data/fixtures/emails/emails_single_email.yml +1 -1
  31. data/fixtures/inbound_routing/inbound_routing_delete.yml +1 -1
  32. data/fixtures/inbound_routing/inbound_routing_list.yml +1 -1
  33. data/fixtures/inbound_routing/inbound_routing_single.yml +1 -1
  34. data/fixtures/messages/messages_list_messages.yml +1 -1
  35. data/fixtures/messages/messages_single_message.yml +1 -1
  36. data/fixtures/recipients/recipients_delete.yml +1 -1
  37. data/fixtures/recipients/recipients_list.yml +1 -1
  38. data/fixtures/recipients/recipients_single.yml +1 -1
  39. data/fixtures/scheduled_messages/scheduled_messages_delete.yml +1 -1
  40. data/fixtures/scheduled_messages/scheduled_messages_get_list.yml +1 -1
  41. data/fixtures/scheduled_messages/scheduled_messages_get_single.yml +1 -1
  42. data/fixtures/sms_activity/sms_activity_list.yml +1 -1
  43. data/fixtures/sms_inbounds/sms_inbounds_add_sms_inbound_route.yml +1 -1
  44. data/fixtures/sms_inbounds/sms_inbounds_delete_sms_inbound_route.yml +1 -1
  45. data/fixtures/sms_inbounds/sms_inbounds_get_sms_inbound_route.yml +1 -1
  46. data/fixtures/sms_inbounds/sms_inbounds_list_sms_inbounds.yml +1 -1
  47. data/fixtures/sms_inbounds/sms_inbounds_update_sms_inbound_route.yml +1 -1
  48. data/fixtures/sms_messages/sms_messages_list_sms_messages.yml +1 -1
  49. data/fixtures/sms_number/sms_number_delete.yml +1 -1
  50. data/fixtures/sms_number/sms_number_get.yml +1 -1
  51. data/fixtures/sms_number/sms_number_list.yml +1 -1
  52. data/fixtures/sms_number/sms_number_update.yml +1 -1
  53. data/fixtures/sms_recipient/sms_recipient_get.yml +1 -1
  54. data/fixtures/sms_recipient/sms_recipient_list.yml +1 -1
  55. data/fixtures/sms_recipient/sms_recipient_update.yml +1 -1
  56. data/fixtures/sms_webhooks/sms_webhooks_add_sms_webhook_route.yml +1 -1
  57. data/fixtures/sms_webhooks/sms_webhooks_delete_sms_webhook_route.yml +1 -1
  58. data/fixtures/sms_webhooks/sms_webhooks_get_sms_webhook_route.yml +1 -1
  59. data/fixtures/sms_webhooks/sms_webhooks_list_sms_webhooks.yml +1 -1
  60. data/fixtures/sms_webhooks/sms_webhooks_update_sms_webhook_route.yml +1 -1
  61. data/fixtures/suppressions/suppressions_add_to_blocklist.yml +1 -1
  62. data/fixtures/suppressions/suppressions_add_to_hard_bounces.yml +1 -1
  63. data/fixtures/suppressions/suppressions_add_to_spam_complaints.yml +1 -1
  64. data/fixtures/suppressions/suppressions_add_to_unsubscribers.yml +1 -1
  65. data/fixtures/suppressions/suppressions_delete_from_blocklist.yml +1 -1
  66. data/fixtures/suppressions/suppressions_delete_from_hard_bounces.yml +1 -1
  67. data/fixtures/suppressions/suppressions_delete_from_spam_complaints.yml +1 -1
  68. data/fixtures/suppressions/suppressions_delete_from_unsubscribers.yml +1 -1
  69. data/fixtures/suppressions/suppressions_get_from_blocklist.yml +1 -1
  70. data/fixtures/suppressions/suppressions_get_hard_bounces.yml +1 -1
  71. data/fixtures/suppressions/suppressions_get_spam_complaints.yml +1 -1
  72. data/fixtures/suppressions/suppressions_get_unsubscribes.yml +1 -1
  73. data/fixtures/templates/templates_delete.yml +1 -1
  74. data/fixtures/templates/templates_list.yml +1 -1
  75. data/fixtures/templates/templates_single.yml +1 -1
  76. data/fixtures/tokens/tokens_create.yml +1 -1
  77. data/fixtures/tokens/tokens_delete.yml +1 -1
  78. data/fixtures/tokens/tokens_update.yml +1 -1
  79. data/fixtures/webhooks/webhooks_create.yml +1 -1
  80. data/fixtures/webhooks/webhooks_delete.yml +1 -1
  81. data/fixtures/webhooks/webhooks_list.yml +1 -1
  82. data/fixtures/webhooks/webhooks_single.yml +1 -1
  83. data/fixtures/whatsapp/whatsapp_send.yml +1 -1
  84. data/fixtures/whatsapp/whatsapp_send_multiple_recipients.yml +1 -1
  85. data/fixtures/whatsapp/whatsapp_send_personalization.yml +1 -1
  86. data/fixtures/whatsapp_activities/whatsapp_activities_list.yml +1 -1
  87. data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_get.yml +1 -1
  88. data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_list.yml +1 -1
  89. data/fixtures/whatsapp_items/whatsapp_items_get.yml +1 -1
  90. data/fixtures/whatsapp_items/whatsapp_items_list.yml +1 -1
  91. data/fixtures/whatsapp_messages/whatsapp_messages_get.yml +1 -1
  92. data/fixtures/whatsapp_messages/whatsapp_messages_list.yml +1 -1
  93. data/fixtures/whatsapp_recipient/whatsapp_recipient_get.yml +1 -1
  94. data/fixtures/whatsapp_recipient/whatsapp_recipient_list.yml +1 -1
  95. data/fixtures/whatsapp_templates/whatsapp_templates_get.yml +1 -1
  96. data/fixtures/whatsapp_templates/whatsapp_templates_list.yml +1 -1
  97. data/lib/mailersend/account/account.rb +1 -1
  98. data/lib/mailersend/activity/activity.rb +1 -1
  99. data/lib/mailersend/analytics/analytics.rb +4 -4
  100. data/lib/mailersend/api_quota/api_quota.rb +1 -1
  101. data/lib/mailersend/bulk_email/bulk_email.rb +2 -2
  102. data/lib/mailersend/client.rb +16 -1
  103. data/lib/mailersend/dmarc_monitoring/dmarc_monitoring.rb +9 -9
  104. data/lib/mailersend/domains/domains.rb +8 -8
  105. data/lib/mailersend/email/email.rb +1 -1
  106. data/lib/mailersend/email_verification/email_verification.rb +6 -6
  107. data/lib/mailersend/emails/emails.rb +2 -2
  108. data/lib/mailersend/inbound_routing/inbound_routing.rb +5 -5
  109. data/lib/mailersend/messages/messages.rb +2 -2
  110. data/lib/mailersend/recipients/recipients.rb +3 -3
  111. data/lib/mailersend/scheduled_messages/scheduled_messages.rb +3 -3
  112. data/lib/mailersend/sender_identity/sender_identity.rb +8 -8
  113. data/lib/mailersend/sms/sms.rb +1 -1
  114. data/lib/mailersend/sms_activity/sms_activity.rb +1 -1
  115. data/lib/mailersend/sms_inbounds/sms_inbounds.rb +5 -5
  116. data/lib/mailersend/sms_messages/sms_messages.rb +2 -2
  117. data/lib/mailersend/sms_number/sms_number.rb +4 -4
  118. data/lib/mailersend/sms_recipient/sms_recipient.rb +3 -3
  119. data/lib/mailersend/sms_webhooks/sms_webhooks.rb +5 -5
  120. data/lib/mailersend/suppressions/suppressions.rb +12 -12
  121. data/lib/mailersend/templates/templates.rb +3 -3
  122. data/lib/mailersend/tokens/tokens.rb +3 -3
  123. data/lib/mailersend/version.rb +1 -1
  124. data/lib/mailersend/webhooks/webhooks.rb +5 -5
  125. data/lib/mailersend/whatsapp/whatsapp.rb +1 -1
  126. data/lib/mailersend/whatsapp_activities/whatsapp_activities.rb +1 -1
  127. data/lib/mailersend/whatsapp_inbound_messages/whatsapp_inbound_messages.rb +2 -2
  128. data/lib/mailersend/whatsapp_items/whatsapp_items.rb +2 -2
  129. data/lib/mailersend/whatsapp_messages/whatsapp_messages.rb +2 -2
  130. data/lib/mailersend/whatsapp_recipient/whatsapp_recipient.rb +2 -2
  131. data/lib/mailersend/whatsapp_templates/whatsapp_templates.rb +2 -2
  132. data/spec/account_rspec.rb +1 -1
  133. data/spec/client_rspec.rb +33 -0
  134. data/spec/emails_rspec.rb +7 -7
  135. metadata +2 -1
@@ -19,7 +19,7 @@ module Mailersend
19
19
  hash = {
20
20
  'email' => email
21
21
  }
22
- client.http.post("#{MAILERSEND_API_URL}/email-verification/verify", json: hash.compact)
22
+ client.http.post("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/email-verification',
30
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}")
35
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/email-verification", json: hash.compact)
43
+ client.http.post("#{client.api_base_url}/email-verification", json: hash.compact)
44
44
  end
45
45
 
46
46
  def verify_a_list(email_verification_id:)
47
- client.http.get("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}/verify")
47
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/email-verification/#{email_verification_id}/results")
51
+ client.http.get("#{client.api_base_url}/email-verification/#{email_verification_id}/results")
52
52
  end
53
53
  end
54
54
  end
@@ -33,12 +33,12 @@ module Mailersend
33
33
  'tag' => tag
34
34
  }
35
35
 
36
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/emails',
36
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/emails",
37
37
  query: URI.encode_www_form(hash.compact)))
38
38
  end
39
39
 
40
40
  def single(email_id:)
41
- client.http.get("#{MAILERSEND_API_URL}/email/#{email_id}")
41
+ client.http.get("#{client.api_base_url}/email/#{email_id}")
42
42
  end
43
43
  end
44
44
  end
@@ -20,23 +20,23 @@ module Mailersend
20
20
  end
21
21
 
22
22
  def get_inbound_routes(*)
23
- client.http.get("#{MAILERSEND_API_URL}/inbound")
23
+ client.http.get("#{client.api_base_url}/inbound")
24
24
  end
25
25
 
26
26
  def get_single_route(inbound_id:)
27
- client.http.get("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
27
+ client.http.get("#{client.api_base_url}/inbound/#{inbound_id}")
28
28
  end
29
29
 
30
30
  def add_inbound_route
31
- client.http.post("#{MAILERSEND_API_URL}/inbound", json: @settings)
31
+ client.http.post("#{client.api_base_url}/inbound", json: @settings)
32
32
  end
33
33
 
34
34
  def update_inbound_route(inbound_id:)
35
- client.http.put("#{MAILERSEND_API_URL}/inbound/#{inbound_id}", json: @settings)
35
+ client.http.put("#{client.api_base_url}/inbound/#{inbound_id}", json: @settings)
36
36
  end
37
37
 
38
38
  def delete_route(inbound_id:)
39
- client.http.delete("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
39
+ client.http.delete("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/messages',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/messages",
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def single(message_id:)
29
- client.http.get("#{MAILERSEND_API_URL}/messages/#{message_id}")
29
+ client.http.get("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/recipients',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/recipients",
25
25
  query: URI.encode_www_form(hash)))
26
26
  end
27
27
 
28
28
  def single(recipient_id:)
29
- client.http.get("#{MAILERSEND_API_URL}/recipients/#{recipient_id}")
29
+ client.http.get("#{client.api_base_url}/recipients/#{recipient_id}")
30
30
  end
31
31
 
32
32
  def delete(recipient_id:)
33
- client.http.delete("#{MAILERSEND_API_URL}/recipients/#{recipient_id}")
33
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/message-schedules")
23
+ client.http.get("#{client.api_base_url}/message-schedules")
24
24
  end
25
25
 
26
26
  def get_single(message_id:)
27
- client.http.get("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
27
+ client.http.get("#{client.api_base_url}/message-schedules/#{message_id}")
28
28
  end
29
29
 
30
30
  def delete(message_id:)
31
- client.http.delete("#{MAILERSEND_API_URL}/message-schedules/#{message_id}")
31
+ client.http.delete("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/identities',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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: MAILERSEND_API_BASE_HOST, path: "/v1/identities/#{identity_id}",
36
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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: MAILERSEND_API_BASE_HOST, path: "/v1/identities/email/#{email}",
44
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/identities", json: hash.compact)
58
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/identities/#{identity_id}", json: hash.compact)
71
+ client.http.put("#{client.api_base_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("#{MAILERSEND_API_URL}/identities/email/#{email}", json: hash.compact)
84
+ client.http.put("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: "/v1/identities/#{identity_id}"))
88
+ client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/identities/#{identity_id}"))
89
89
  end
90
90
 
91
91
  def delete_by_email(email:)
92
- client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/identities/email/#{email}"))
92
+ client.http.delete(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
44
+ response = client.http.post("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-activity',
22
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-inbounds',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}")
33
+ client.http.get("#{client.api_base_url}/sms-inbounds/#{sms_inbound_id}")
34
34
  end
35
35
 
36
36
  def add_sms_inbound_route
37
- client.http.post("#{MAILERSEND_API_URL}/sms-inbounds", json: @settings)
37
+ client.http.post("#{client.api_base_url}/sms-inbounds", json: @settings)
38
38
  end
39
39
 
40
40
  def update_sms_inbound_route(sms_inbound_id:)
41
- client.http.put("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}", json: @settings)
41
+ client.http.put("#{client.api_base_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("#{MAILERSEND_API_URL}/sms-inbounds/#{sms_inbound_id}")
45
+ client.http.delete("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-messages',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms-messages/#{sms_message_id}")
29
+ client.http.get_single_route("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-numbers',
26
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}")
31
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}", json: hash.compact)
38
+ client.http.put("#{client.api_base_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("#{MAILERSEND_API_URL}/sms-numbers/#{sms_number_id}")
42
+ client.http.delete("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-recipients',
28
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms-recipients/#{sms_recipient_id}")
33
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/sms-recipients/#{sms_recipient_id}", json: hash.compact)
40
+ client.http.put("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/sms-webhooks',
24
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/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("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}")
29
+ client.http.get("#{client.api_base_url}/sms-webhooks/#{sms_webhook_id}")
30
30
  end
31
31
 
32
32
  def add_sms_webhook_route
33
- client.http.post("#{MAILERSEND_API_URL}/sms-webhooks", json: @settings)
33
+ client.http.post("#{client.api_base_url}/sms-webhooks", json: @settings)
34
34
  end
35
35
 
36
36
  def update_sms_webhook_route(sms_webhook_id:)
37
- client.http.put("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}", json: @settings)
37
+ client.http.put("#{client.api_base_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("#{MAILERSEND_API_URL}/sms-webhooks/#{sms_webhook_id}")
41
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/blocklist")
19
+ client.http.get("#{client.api_base_url}/suppressions/blocklist")
20
20
  end
21
21
 
22
22
  def get_hard_bounces(*)
23
- client.http.get("#{MAILERSEND_API_URL}/suppressions/hard-bounces")
23
+ client.http.get("#{client.api_base_url}/suppressions/hard-bounces")
24
24
  end
25
25
 
26
26
  def get_spam_complaints(*)
27
- client.http.get("#{MAILERSEND_API_URL}/suppressions/spam-complaints")
27
+ client.http.get("#{client.api_base_url}/suppressions/spam-complaints")
28
28
  end
29
29
 
30
30
  def get_unsubscribes(*)
31
- client.http.get("#{MAILERSEND_API_URL}/suppressions/unsubscribes")
31
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/blocklist", json: hash.compact)
39
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/blocklist", json: hash.compact)
48
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/hard-bounces", json: hash.compact)
56
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/hard-bounces", json: hash.compact)
65
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/spam-complaints", json: hash.compact)
73
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/spam-complaints", json: hash.compact)
82
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/unsubscribes", json: hash.compact)
90
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/suppressions/unsubscribes", json: hash.compact)
99
+ client.http.delete("#{client.api_base_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: MAILERSEND_API_BASE_HOST, path: '/v1/templates',
25
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/templates",
26
26
  query: URI.encode_www_form(hash)))
27
27
  end
28
28
 
29
29
  def single(template_id:)
30
- client.http.get("#{MAILERSEND_API_URL}/templates/#{template_id}")
30
+ client.http.get("#{client.api_base_url}/templates/#{template_id}")
31
31
  end
32
32
 
33
33
  def delete(template_id:)
34
- client.http.delete("#{MAILERSEND_API_URL}/templates/#{template_id}")
34
+ client.http.delete("#{client.api_base_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("#{MAILERSEND_API_URL}/token", json: json)
26
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/token/#{token_id}/settings", json: status)
33
+ client.http.put("#{client.api_base_url}/token/#{token_id}/settings", json: status)
34
34
  end
35
35
 
36
36
  def delete(token_id:)
37
- client.http.delete("#{MAILERSEND_API_URL}/token/#{token_id}")
37
+ client.http.delete("#{client.api_base_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 = '3.5.0'
4
+ VERSION = '3.6.0'
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: MAILERSEND_API_BASE_HOST, path: '/v1/webhooks',
27
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/webhooks",
28
28
  query: URI.encode_www_form(hash)))
29
29
  end
30
30
 
31
31
  def single(webhook_id:)
32
- client.http.get("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}")
32
+ client.http.get("#{client.api_base_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("#{MAILERSEND_API_URL}/webhooks", json: hash.compact)
44
+ client.http.post("#{client.api_base_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("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}", json: hash.compact)
54
+ client.http.put("#{client.api_base_url}/webhooks/#{webhook_id}", json: hash.compact)
55
55
  end
56
56
 
57
57
  def delete(webhook_id:)
58
- client.http.delete("#{MAILERSEND_API_URL}/webhooks/#{webhook_id}")
58
+ client.http.delete("#{client.api_base_url}/webhooks/#{webhook_id}")
59
59
  end
60
60
  end
61
61
  end
@@ -41,7 +41,7 @@ module Mailersend
41
41
  'personalization' => @personalization
42
42
  }
43
43
 
44
- client.http.post("#{MAILERSEND_API_URL}/whatsapp/send", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
44
+ client.http.post("#{client.api_base_url}/whatsapp/send", json: message.delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {} })
45
45
  end
46
46
  end
47
47
  end
@@ -38,7 +38,7 @@ module Mailersend
38
38
  'limit' => limit
39
39
  }
40
40
 
41
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/activities',
41
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/activities",
42
42
  query: URI.encode_www_form(hash.compact)))
43
43
  end
44
44
  end
@@ -36,12 +36,12 @@ module Mailersend
36
36
  'limit' => limit
37
37
  }
38
38
 
39
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/inbound-messages',
39
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/inbound-messages",
40
40
  query: URI.encode_www_form(hash.compact)))
41
41
  end
42
42
 
43
43
  def get(whatsapp_inbound_message_id:)
44
- client.http.get("#{MAILERSEND_API_URL}/whatsapp/inbound-messages/#{whatsapp_inbound_message_id}")
44
+ client.http.get("#{client.api_base_url}/whatsapp/inbound-messages/#{whatsapp_inbound_message_id}")
45
45
  end
46
46
  end
47
47
  end
@@ -46,12 +46,12 @@ module Mailersend
46
46
  'limit' => limit
47
47
  }
48
48
 
49
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/items',
49
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/items",
50
50
  query: URI.encode_www_form(hash.compact)))
51
51
  end
52
52
 
53
53
  def get(whatsapp_item_id:)
54
- client.http.get("#{MAILERSEND_API_URL}/whatsapp/items/#{whatsapp_item_id}")
54
+ client.http.get("#{client.api_base_url}/whatsapp/items/#{whatsapp_item_id}")
55
55
  end
56
56
  end
57
57
  end
@@ -36,12 +36,12 @@ module Mailersend
36
36
  'limit' => limit
37
37
  }
38
38
 
39
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/messages',
39
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/messages",
40
40
  query: URI.encode_www_form(hash.compact)))
41
41
  end
42
42
 
43
43
  def get(whatsapp_message_id:)
44
- client.http.get("#{MAILERSEND_API_URL}/whatsapp/messages/#{whatsapp_message_id}")
44
+ client.http.get("#{client.api_base_url}/whatsapp/messages/#{whatsapp_message_id}")
45
45
  end
46
46
  end
47
47
  end
@@ -27,12 +27,12 @@ module Mailersend
27
27
  'limit' => limit
28
28
  }
29
29
 
30
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/recipients',
30
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/recipients",
31
31
  query: URI.encode_www_form(hash.compact)))
32
32
  end
33
33
 
34
34
  def get(whatsapp_recipient_id:)
35
- client.http.get("#{MAILERSEND_API_URL}/whatsapp/recipients/#{whatsapp_recipient_id}")
35
+ client.http.get("#{client.api_base_url}/whatsapp/recipients/#{whatsapp_recipient_id}")
36
36
  end
37
37
  end
38
38
  end
@@ -33,12 +33,12 @@ module Mailersend
33
33
  'limit' => limit
34
34
  }
35
35
 
36
- client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/whatsapp/templates',
36
+ client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "#{client.api_path}/whatsapp/templates",
37
37
  query: URI.encode_www_form(hash.compact)))
38
38
  end
39
39
 
40
40
  def get(whatsapp_template_id:)
41
- client.http.get("#{MAILERSEND_API_URL}/whatsapp/templates/#{whatsapp_template_id}")
41
+ client.http.get("#{client.api_base_url}/whatsapp/templates/#{whatsapp_template_id}")
42
42
  end
43
43
  end
44
44
  end