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.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/fixtures/account/account_get.yml +1 -1
- data/fixtures/account/account_get_without_whatsapp.yml +1 -1
- data/fixtures/activity/activity_get_activity.yml +1 -1
- data/fixtures/api_quota/api_quota_get.yml +1 -1
- data/fixtures/bulk_email/bulk_email_send.yml +1 -1
- data/fixtures/bulk_email/bulk_email_status.yml +1 -1
- data/fixtures/dmarc_monitoring/add_favorite.yml +1 -1
- data/fixtures/dmarc_monitoring/create.yml +1 -1
- data/fixtures/dmarc_monitoring/delete.yml +1 -1
- data/fixtures/dmarc_monitoring/list.yml +1 -1
- data/fixtures/dmarc_monitoring/remove_favorite.yml +1 -1
- data/fixtures/dmarc_monitoring/report.yml +1 -1
- data/fixtures/dmarc_monitoring/report_by_ip.yml +1 -1
- data/fixtures/dmarc_monitoring/report_sources.yml +1 -1
- data/fixtures/dmarc_monitoring/update.yml +1 -1
- data/fixtures/domains/domains_add.yml +1 -1
- data/fixtures/domains/domains_delete.yml +1 -1
- data/fixtures/domains/domains_dns.yml +1 -1
- data/fixtures/domains/domains_list.yml +1 -1
- data/fixtures/domains/domains_recipients.yml +1 -1
- data/fixtures/domains/domains_settings.yml +1 -1
- data/fixtures/domains/domains_single.yml +1 -1
- data/fixtures/domains/domains_verify.yml +1 -1
- data/fixtures/email/email_send.yml +1 -1
- data/fixtures/email/email_send_template_language.yml +1 -1
- data/fixtures/emails/emails_list_emails.yml +1 -1
- data/fixtures/emails/emails_list_emails_empty_page.yml +1 -1
- data/fixtures/emails/emails_single_email.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_delete.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_list.yml +1 -1
- data/fixtures/inbound_routing/inbound_routing_single.yml +1 -1
- data/fixtures/messages/messages_list_messages.yml +1 -1
- data/fixtures/messages/messages_single_message.yml +1 -1
- data/fixtures/recipients/recipients_delete.yml +1 -1
- data/fixtures/recipients/recipients_list.yml +1 -1
- data/fixtures/recipients/recipients_single.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_delete.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_get_list.yml +1 -1
- data/fixtures/scheduled_messages/scheduled_messages_get_single.yml +1 -1
- data/fixtures/sms_activity/sms_activity_list.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_add_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_delete_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_get_sms_inbound_route.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_list_sms_inbounds.yml +1 -1
- data/fixtures/sms_inbounds/sms_inbounds_update_sms_inbound_route.yml +1 -1
- data/fixtures/sms_messages/sms_messages_list_sms_messages.yml +1 -1
- data/fixtures/sms_number/sms_number_delete.yml +1 -1
- data/fixtures/sms_number/sms_number_get.yml +1 -1
- data/fixtures/sms_number/sms_number_list.yml +1 -1
- data/fixtures/sms_number/sms_number_update.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_get.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_list.yml +1 -1
- data/fixtures/sms_recipient/sms_recipient_update.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_add_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_delete_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_get_sms_webhook_route.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_list_sms_webhooks.yml +1 -1
- data/fixtures/sms_webhooks/sms_webhooks_update_sms_webhook_route.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_add_to_unsubscribers.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_delete_from_unsubscribers.yml +1 -1
- data/fixtures/suppressions/suppressions_get_from_blocklist.yml +1 -1
- data/fixtures/suppressions/suppressions_get_hard_bounces.yml +1 -1
- data/fixtures/suppressions/suppressions_get_spam_complaints.yml +1 -1
- data/fixtures/suppressions/suppressions_get_unsubscribes.yml +1 -1
- data/fixtures/templates/templates_delete.yml +1 -1
- data/fixtures/templates/templates_list.yml +1 -1
- data/fixtures/templates/templates_single.yml +1 -1
- data/fixtures/tokens/tokens_create.yml +1 -1
- data/fixtures/tokens/tokens_delete.yml +1 -1
- data/fixtures/tokens/tokens_update.yml +1 -1
- data/fixtures/webhooks/webhooks_create.yml +1 -1
- data/fixtures/webhooks/webhooks_delete.yml +1 -1
- data/fixtures/webhooks/webhooks_list.yml +1 -1
- data/fixtures/webhooks/webhooks_single.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send_multiple_recipients.yml +1 -1
- data/fixtures/whatsapp/whatsapp_send_personalization.yml +1 -1
- data/fixtures/whatsapp_activities/whatsapp_activities_list.yml +1 -1
- data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_get.yml +1 -1
- data/fixtures/whatsapp_inbound_messages/whatsapp_inbound_messages_list.yml +1 -1
- data/fixtures/whatsapp_items/whatsapp_items_get.yml +1 -1
- data/fixtures/whatsapp_items/whatsapp_items_list.yml +1 -1
- data/fixtures/whatsapp_messages/whatsapp_messages_get.yml +1 -1
- data/fixtures/whatsapp_messages/whatsapp_messages_list.yml +1 -1
- data/fixtures/whatsapp_recipient/whatsapp_recipient_get.yml +1 -1
- data/fixtures/whatsapp_recipient/whatsapp_recipient_list.yml +1 -1
- data/fixtures/whatsapp_templates/whatsapp_templates_get.yml +1 -1
- data/fixtures/whatsapp_templates/whatsapp_templates_list.yml +1 -1
- data/lib/mailersend/account/account.rb +1 -1
- data/lib/mailersend/activity/activity.rb +1 -1
- data/lib/mailersend/analytics/analytics.rb +4 -4
- data/lib/mailersend/api_quota/api_quota.rb +1 -1
- data/lib/mailersend/bulk_email/bulk_email.rb +2 -2
- data/lib/mailersend/client.rb +16 -1
- data/lib/mailersend/dmarc_monitoring/dmarc_monitoring.rb +9 -9
- data/lib/mailersend/domains/domains.rb +8 -8
- data/lib/mailersend/email/email.rb +1 -1
- data/lib/mailersend/email_verification/email_verification.rb +6 -6
- data/lib/mailersend/emails/emails.rb +2 -2
- data/lib/mailersend/inbound_routing/inbound_routing.rb +5 -5
- data/lib/mailersend/messages/messages.rb +2 -2
- data/lib/mailersend/recipients/recipients.rb +3 -3
- data/lib/mailersend/scheduled_messages/scheduled_messages.rb +3 -3
- data/lib/mailersend/sender_identity/sender_identity.rb +8 -8
- data/lib/mailersend/sms/sms.rb +1 -1
- data/lib/mailersend/sms_activity/sms_activity.rb +1 -1
- data/lib/mailersend/sms_inbounds/sms_inbounds.rb +5 -5
- data/lib/mailersend/sms_messages/sms_messages.rb +2 -2
- data/lib/mailersend/sms_number/sms_number.rb +4 -4
- data/lib/mailersend/sms_recipient/sms_recipient.rb +3 -3
- data/lib/mailersend/sms_webhooks/sms_webhooks.rb +5 -5
- data/lib/mailersend/suppressions/suppressions.rb +12 -12
- data/lib/mailersend/templates/templates.rb +3 -3
- data/lib/mailersend/tokens/tokens.rb +3 -3
- data/lib/mailersend/version.rb +1 -1
- data/lib/mailersend/webhooks/webhooks.rb +5 -5
- data/lib/mailersend/whatsapp/whatsapp.rb +1 -1
- data/lib/mailersend/whatsapp_activities/whatsapp_activities.rb +1 -1
- data/lib/mailersend/whatsapp_inbound_messages/whatsapp_inbound_messages.rb +2 -2
- data/lib/mailersend/whatsapp_items/whatsapp_items.rb +2 -2
- data/lib/mailersend/whatsapp_messages/whatsapp_messages.rb +2 -2
- data/lib/mailersend/whatsapp_recipient/whatsapp_recipient.rb +2 -2
- data/lib/mailersend/whatsapp_templates/whatsapp_templates.rb +2 -2
- data/spec/account_rspec.rb +1 -1
- data/spec/client_rspec.rb +33 -0
- data/spec/emails_rspec.rb +7 -7
- metadata +2 -1
|
@@ -19,7 +19,7 @@ module Mailersend
|
|
|
19
19
|
hash = {
|
|
20
20
|
'email' => email
|
|
21
21
|
}
|
|
22
|
-
client.http.post("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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: "/
|
|
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: "/
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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: "/
|
|
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: "/
|
|
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
|
data/lib/mailersend/sms/sms.rb
CHANGED
|
@@ -41,7 +41,7 @@ module Mailersend
|
|
|
41
41
|
'personalization' => @personalization
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
response = client.http.post("#{
|
|
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:
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
37
|
+
client.http.delete("#{client.api_base_url}/token/#{token_id}")
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/lib/mailersend/version.rb
CHANGED
|
@@ -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:
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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("#{
|
|
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:
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
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:
|
|
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("#{
|
|
41
|
+
client.http.get("#{client.api_base_url}/whatsapp/templates/#{whatsapp_template_id}")
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
end
|