sendpost_ruby_sdk 2.0.2 → 3.0.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 +612 -531
- data/docs/AccountCycleUsage.md +18 -0
- data/docs/AccountStats.md +3 -3
- data/docs/AccountWebhookWithStats.md +58 -0
- data/docs/AggregateStat.md +14 -14
- data/docs/AggregateStats.md +22 -22
- data/docs/Attachment.md +4 -4
- data/docs/BlacklistLinks.md +20 -0
- data/docs/BlacklistResource.md +38 -0
- data/docs/BlacklistedOn.md +20 -0
- data/docs/CopyTo.md +6 -6
- data/docs/CreateDomainRequest.md +2 -2
- data/docs/CreateSuppressionRequest.md +4 -4
- data/docs/CreateSuppressionRequestHardBounceInner.md +1 -1
- data/docs/CreateSuppressionRequestManualInner.md +1 -1
- data/docs/CreateSuppressionRequestSpamComplaintInner.md +1 -1
- data/docs/CreateSuppressionRequestUnsubscribeInner.md +1 -1
- data/docs/DailyStatistics.md +38 -0
- data/docs/DateStat.md +40 -0
- data/docs/DeleteResponse.md +4 -4
- data/docs/DeleteSubAccountResponse.md +4 -4
- data/docs/{DeleteSuppression200ResponseInner.md → DeleteSuppression200Response.md} +2 -4
- data/docs/DeleteSuppressionRequest.md +1 -1
- data/docs/{EmailMessageReplyTo.md → DeleteSuppressionRequestSuppressionsInner.md} +3 -5
- data/docs/DeleteWebhookResponse.md +3 -3
- data/docs/Device.md +2 -2
- data/docs/DnsRecord.md +22 -0
- data/docs/Domain.md +24 -28
- data/docs/DomainApi.md +66 -66
- data/docs/DomainStat.md +46 -0
- data/docs/EIP.md +1 -1
- data/docs/EmailAddress.md +4 -4
- data/docs/EmailApi.md +4 -4
- data/docs/EmailMessage.md +30 -30
- data/docs/EmailMessageObject.md +33 -26
- data/docs/EmailMessageWithTemplate.md +32 -27
- data/docs/EmailResponse.md +10 -10
- data/docs/EmailTypeStat.md +40 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/ErrorResponseError.md +26 -0
- data/docs/ErrorResponseErrorDetailsInner.md +20 -0
- data/docs/Event.md +18 -36
- data/docs/EventMetadata.md +14 -14
- data/docs/GeoLocation.md +8 -8
- data/docs/GroupStat.md +40 -0
- data/docs/IP.md +13 -43
- data/docs/IPAllocationRequest.md +4 -4
- data/docs/IPApi.md +19 -19
- data/docs/IPDeletionResponse.md +2 -2
- data/docs/IPPool.md +13 -21
- data/docs/IPPoolCreateRequest.md +10 -8
- data/docs/IPPoolDeleteResponse.md +2 -2
- data/docs/IPPoolStat.md +44 -0
- data/docs/IPPoolUpdateRequest.md +13 -7
- data/docs/IPPoolsApi.md +26 -19
- data/docs/IPStat.md +46 -0
- data/docs/IPUpdateRequest.md +2 -2
- data/docs/Label.md +10 -6
- data/docs/Member.md +15 -21
- data/docs/Message.md +37 -53
- data/docs/MessageApi.md +83 -3
- data/docs/NewSubAccount.md +18 -0
- data/docs/NewWebhook.md +46 -0
- data/docs/Os.md +26 -0
- data/docs/PostmasterDomainStat.md +30 -0
- data/docs/ProviderStat.md +40 -0
- data/docs/RAIPPoolStat.md +20 -0
- data/docs/RDStat.md +20 -0
- data/docs/RIPStat.md +20 -0
- data/docs/RStat.md +20 -0
- data/docs/Recipient.md +8 -8
- data/docs/SDStat.md +42 -0
- data/docs/SMTPAuth.md +5 -9
- data/docs/SeedContactStats.md +28 -0
- data/docs/Stat.md +22 -4
- data/docs/StatsAApi.md +24 -24
- data/docs/StatsApi.md +19 -19
- data/docs/SubAccount.md +13 -27
- data/docs/SubAccountApi.md +23 -23
- data/docs/SubAccountStat.md +44 -0
- data/docs/SubAccountStatForPool.md +42 -0
- data/docs/Suppression.md +14 -10
- data/docs/SuppressionApi.md +19 -19
- data/docs/TPSPStat.md +42 -0
- data/docs/UpdateSubAccount.md +2 -2
- data/docs/UpdateWebhook.md +23 -23
- data/docs/UserAgent.md +7 -7
- data/docs/ValidationStat.md +32 -0
- data/docs/Webhook.md +31 -29
- data/docs/WebhookApi.md +28 -28
- data/docs/WebhookObject.md +20 -0
- data/docs/WebhookReferenceApi.md +71 -0
- data/lib/sendpost_ruby_sdk/api/domain_api.rb +84 -84
- data/lib/sendpost_ruby_sdk/api/email_api.rb +6 -6
- data/lib/sendpost_ruby_sdk/api/ip_api.rb +24 -24
- data/lib/sendpost_ruby_sdk/api/ip_pools_api.rb +25 -25
- data/lib/sendpost_ruby_sdk/api/message_api.rb +83 -6
- data/lib/sendpost_ruby_sdk/api/stats_a_api.rb +30 -30
- data/lib/sendpost_ruby_sdk/api/stats_api.rb +24 -24
- data/lib/sendpost_ruby_sdk/api/sub_account_api.rb +33 -33
- data/lib/sendpost_ruby_sdk/api/suppression_api.rb +23 -23
- data/lib/sendpost_ruby_sdk/api/webhook_api.rb +36 -36
- data/lib/sendpost_ruby_sdk/api/webhook_reference_api.rb +82 -0
- data/lib/sendpost_ruby_sdk/api_client.rb +2 -2
- data/lib/sendpost_ruby_sdk/api_error.rb +2 -2
- data/lib/sendpost_ruby_sdk/configuration.rb +2 -2
- data/lib/sendpost_ruby_sdk/models/account_cycle_usage.rb +222 -0
- data/lib/sendpost_ruby_sdk/models/account_stats.rb +5 -3
- data/lib/sendpost_ruby_sdk/models/account_webhook_with_stats.rb +463 -0
- data/lib/sendpost_ruby_sdk/models/aggregate_stat.rb +37 -29
- data/lib/sendpost_ruby_sdk/models/aggregate_stats.rb +43 -24
- data/lib/sendpost_ruby_sdk/models/attachment.rb +48 -4
- data/lib/sendpost_ruby_sdk/models/blacklist_links.rb +232 -0
- data/lib/sendpost_ruby_sdk/models/blacklist_resource.rb +323 -0
- data/lib/sendpost_ruby_sdk/models/blacklisted_on.rb +232 -0
- data/lib/sendpost_ruby_sdk/models/copy_to.rb +42 -3
- data/lib/sendpost_ruby_sdk/models/create_domain_request.rb +32 -3
- data/lib/sendpost_ruby_sdk/models/create_suppression_request.rb +6 -6
- data/lib/sendpost_ruby_sdk/models/create_suppression_request_hard_bounce_inner.rb +2 -2
- data/lib/sendpost_ruby_sdk/models/create_suppression_request_manual_inner.rb +2 -2
- data/lib/sendpost_ruby_sdk/models/create_suppression_request_spam_complaint_inner.rb +2 -2
- data/lib/sendpost_ruby_sdk/models/create_suppression_request_unsubscribe_inner.rb +2 -2
- data/lib/sendpost_ruby_sdk/models/daily_statistics.rb +322 -0
- data/lib/sendpost_ruby_sdk/models/date_stat.rb +339 -0
- data/lib/sendpost_ruby_sdk/models/delete_response.rb +5 -4
- data/lib/sendpost_ruby_sdk/models/delete_sub_account_response.rb +5 -4
- data/lib/sendpost_ruby_sdk/models/delete_suppression200_response.rb +221 -0
- data/lib/sendpost_ruby_sdk/models/delete_suppression_request.rb +4 -3
- data/lib/sendpost_ruby_sdk/models/delete_suppression_request_suppressions_inner.rb +220 -0
- data/lib/sendpost_ruby_sdk/models/delete_webhook_response.rb +5 -4
- data/lib/sendpost_ruby_sdk/models/device.rb +5 -3
- data/lib/sendpost_ruby_sdk/models/dns_record.rb +276 -0
- data/lib/sendpost_ruby_sdk/models/domain.rb +42 -85
- data/lib/sendpost_ruby_sdk/models/domain_stat.rb +369 -0
- data/lib/sendpost_ruby_sdk/models/eip.rb +4 -3
- data/lib/sendpost_ruby_sdk/models/email_address.rb +41 -2
- data/lib/sendpost_ruby_sdk/models/email_message.rb +26 -9
- data/lib/sendpost_ruby_sdk/models/email_message_object.rb +123 -3
- data/lib/sendpost_ruby_sdk/models/email_message_with_template.rb +121 -12
- data/lib/sendpost_ruby_sdk/models/email_response.rb +8 -4
- data/lib/sendpost_ruby_sdk/models/email_type_stat.rb +339 -0
- data/lib/sendpost_ruby_sdk/models/error_response.rb +221 -0
- data/lib/sendpost_ruby_sdk/models/error_response_error.rb +297 -0
- data/lib/sendpost_ruby_sdk/models/error_response_error_details_inner.rb +231 -0
- data/lib/sendpost_ruby_sdk/models/event.rb +94 -118
- data/lib/sendpost_ruby_sdk/models/event_metadata.rb +15 -5
- data/lib/sendpost_ruby_sdk/models/geo_location.rb +20 -14
- data/lib/sendpost_ruby_sdk/models/group_stat.rb +339 -0
- data/lib/sendpost_ruby_sdk/models/ip.rb +72 -375
- data/lib/sendpost_ruby_sdk/models/ip_allocation_request.rb +29 -33
- data/lib/sendpost_ruby_sdk/models/ip_deletion_response.rb +5 -4
- data/lib/sendpost_ruby_sdk/models/ip_pool.rb +94 -82
- data/lib/sendpost_ruby_sdk/models/ip_pool_create_request.rb +91 -29
- data/lib/sendpost_ruby_sdk/models/ip_pool_delete_response.rb +5 -2
- data/lib/sendpost_ruby_sdk/models/ip_pool_stat.rb +359 -0
- data/lib/sendpost_ruby_sdk/models/ip_pool_update_request.rb +97 -7
- data/lib/sendpost_ruby_sdk/models/ip_stat.rb +369 -0
- data/lib/sendpost_ruby_sdk/models/ip_update_request.rb +4 -20
- data/lib/sendpost_ruby_sdk/models/label.rb +101 -6
- data/lib/sendpost_ruby_sdk/models/member.rb +49 -57
- data/lib/sendpost_ruby_sdk/models/message.rb +39 -120
- data/lib/sendpost_ruby_sdk/models/new_sub_account.rb +257 -0
- data/lib/sendpost_ruby_sdk/models/new_webhook.rb +407 -0
- data/lib/sendpost_ruby_sdk/models/os.rb +262 -0
- data/lib/sendpost_ruby_sdk/models/postmaster_domain_stat.rb +282 -0
- data/lib/sendpost_ruby_sdk/models/provider_stat.rb +339 -0
- data/lib/sendpost_ruby_sdk/models/r_stat.rb +231 -0
- data/lib/sendpost_ruby_sdk/models/raip_pool_stat.rb +231 -0
- data/lib/sendpost_ruby_sdk/models/rd_stat.rb +231 -0
- data/lib/sendpost_ruby_sdk/models/recipient.rb +82 -3
- data/lib/sendpost_ruby_sdk/models/rip_stat.rb +231 -0
- data/lib/sendpost_ruby_sdk/models/sd_stat.rb +349 -0
- data/lib/sendpost_ruby_sdk/models/seed_contact_stats.rb +281 -0
- data/lib/sendpost_ruby_sdk/models/smtp_auth.rb +10 -29
- data/lib/sendpost_ruby_sdk/models/stat.rb +108 -16
- data/lib/sendpost_ruby_sdk/models/sub_account.rb +57 -115
- data/lib/sendpost_ruby_sdk/models/sub_account_stat.rb +359 -0
- data/lib/sendpost_ruby_sdk/models/sub_account_stat_for_pool.rb +349 -0
- data/lib/sendpost_ruby_sdk/models/suppression.rb +82 -15
- data/lib/sendpost_ruby_sdk/models/tpsp_stat.rb +349 -0
- data/lib/sendpost_ruby_sdk/models/update_sub_account.rb +32 -3
- data/lib/sendpost_ruby_sdk/models/update_webhook.rb +83 -37
- data/lib/sendpost_ruby_sdk/models/user_agent.rb +11 -6
- data/lib/sendpost_ruby_sdk/models/validation_stat.rb +292 -0
- data/lib/sendpost_ruby_sdk/models/webhook.rb +108 -67
- data/lib/sendpost_ruby_sdk/models/webhook_object.rb +232 -0
- data/lib/sendpost_ruby_sdk/version.rb +3 -3
- data/lib/sendpost_ruby_sdk.rb +36 -27
- data/sendpost_ruby_sdk.gemspec +39 -0
- data/spec/api/webhook_reference_api_spec.rb +46 -0
- data/spec/models/account_cycle_usage_spec.rb +36 -0
- data/spec/models/account_webhook_with_stats_spec.rb +160 -0
- data/spec/models/blacklist_links_spec.rb +42 -0
- data/spec/models/blacklist_resource_spec.rb +96 -0
- data/spec/models/blacklisted_on_spec.rb +42 -0
- data/spec/models/daily_statistics_spec.rb +96 -0
- data/spec/models/date_stat_spec.rb +102 -0
- data/spec/models/delete_suppression200_response_spec.rb +36 -0
- data/spec/models/delete_suppression_request_suppressions_inner_spec.rb +36 -0
- data/spec/models/dns_record_spec.rb +52 -0
- data/spec/models/domain_stat_spec.rb +120 -0
- data/spec/models/email_type_stat_spec.rb +102 -0
- data/spec/models/error_response_error_details_inner_spec.rb +42 -0
- data/spec/models/error_response_error_spec.rb +64 -0
- data/spec/models/error_response_spec.rb +36 -0
- data/spec/models/group_stat_spec.rb +102 -0
- data/spec/models/ip_pool_stat_spec.rb +114 -0
- data/spec/models/ip_stat_spec.rb +120 -0
- data/spec/models/new_sub_account_spec.rb +36 -0
- data/spec/models/new_webhook_spec.rb +120 -0
- data/spec/models/os_spec.rb +60 -0
- data/spec/models/postmaster_domain_stat_spec.rb +72 -0
- data/spec/models/provider_stat_spec.rb +102 -0
- data/spec/models/r_stat_spec.rb +42 -0
- data/spec/models/raip_pool_stat_spec.rb +42 -0
- data/spec/models/rd_stat_spec.rb +42 -0
- data/spec/models/rip_stat_spec.rb +42 -0
- data/spec/models/sd_stat_spec.rb +108 -0
- data/spec/models/seed_contact_stats_spec.rb +66 -0
- data/spec/models/sub_account_stat_for_pool_spec.rb +108 -0
- data/spec/models/sub_account_stat_spec.rb +114 -0
- data/spec/models/tpsp_stat_spec.rb +108 -0
- data/spec/models/validation_stat_spec.rb +78 -0
- data/spec/models/webhook_object_spec.rb +42 -0
- data/spec/spec_helper.rb +2 -2
- metadata +143 -219
- data/LICENSE +0 -21
- data/docs/AccountStatsStat.md +0 -38
- data/docs/AggregatedEmailStats.md +0 -38
- data/docs/AutoWarmupPlan.md +0 -80
- data/docs/CreateSubAccountRequest.md +0 -18
- data/docs/CreateWebhookRequest.md +0 -46
- data/docs/DomainDkim.md +0 -22
- data/docs/DomainDmarc.md +0 -22
- data/docs/DomainGpt.md +0 -22
- data/docs/DomainReturnPath.md +0 -22
- data/docs/DomainSpf.md +0 -22
- data/docs/DomainTrack.md +0 -22
- data/docs/EmailMessageFrom.md +0 -20
- data/docs/EmailMessageToInner.md +0 -26
- data/docs/EmailMessageToInnerBccInner.md +0 -22
- data/docs/EmailMessageToInnerCcInner.md +0 -22
- data/docs/EmailStats.md +0 -20
- data/docs/EmailStatsStats.md +0 -38
- data/docs/MessageHeaderTo.md +0 -26
- data/docs/MessageTo.md +0 -26
- data/docs/OperatingSystem.md +0 -26
- data/docs/Person.md +0 -20
- data/docs/StatStat.md +0 -38
- data/docs/StatStats.md +0 -38
- data/docs/ThirdPartySendingProvider.md +0 -38
- data/lib/sendpost_ruby_sdk/models/account_stats_stat.rb +0 -311
- data/lib/sendpost_ruby_sdk/models/aggregated_email_stats.rb +0 -321
- data/lib/sendpost_ruby_sdk/models/auto_warmup_plan.rb +0 -531
- data/lib/sendpost_ruby_sdk/models/create_sub_account_request.rb +0 -221
- data/lib/sendpost_ruby_sdk/models/create_webhook_request.rb +0 -361
- data/lib/sendpost_ruby_sdk/models/delete_suppression200_response_inner.rb +0 -231
- data/lib/sendpost_ruby_sdk/models/domain_dkim.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/domain_dmarc.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/domain_gpt.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/domain_return_path.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/domain_spf.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/domain_track.rb +0 -239
- data/lib/sendpost_ruby_sdk/models/email_message_from.rb +0 -229
- data/lib/sendpost_ruby_sdk/models/email_message_reply_to.rb +0 -229
- data/lib/sendpost_ruby_sdk/models/email_message_to_inner.rb +0 -262
- data/lib/sendpost_ruby_sdk/models/email_message_to_inner_bcc_inner.rb +0 -240
- data/lib/sendpost_ruby_sdk/models/email_message_to_inner_cc_inner.rb +0 -240
- data/lib/sendpost_ruby_sdk/models/email_stats.rb +0 -230
- data/lib/sendpost_ruby_sdk/models/email_stats_stats.rb +0 -321
- data/lib/sendpost_ruby_sdk/models/message_header_to.rb +0 -268
- data/lib/sendpost_ruby_sdk/models/message_to.rb +0 -268
- data/lib/sendpost_ruby_sdk/models/operating_system.rb +0 -256
- data/lib/sendpost_ruby_sdk/models/person.rb +0 -231
- data/lib/sendpost_ruby_sdk/models/stat_stat.rb +0 -322
- data/lib/sendpost_ruby_sdk/models/stat_stats.rb +0 -321
- data/lib/sendpost_ruby_sdk/models/third_party_sending_provider.rb +0 -310
- data/spec/api/domain_api_spec.rb +0 -85
- data/spec/api/email_api_spec.rb +0 -59
- data/spec/api/ip_api_spec.rb +0 -98
- data/spec/api/ip_pools_api_spec.rb +0 -98
- data/spec/api/message_api_spec.rb +0 -47
- data/spec/api/stats_a_api_spec.rb +0 -89
- data/spec/api/stats_api_spec.rb +0 -78
- data/spec/api/sub_account_api_spec.rb +0 -98
- data/spec/api/suppression_api_spec.rb +0 -76
- data/spec/api/webhook_api_spec.rb +0 -98
- data/spec/models/account_stats_spec.rb +0 -42
- data/spec/models/account_stats_stat_spec.rb +0 -96
- data/spec/models/aggregate_stat_spec.rb +0 -96
- data/spec/models/aggregate_stats_spec.rb +0 -96
- data/spec/models/aggregated_email_stats_spec.rb +0 -96
- data/spec/models/attachment_spec.rb +0 -42
- data/spec/models/auto_warmup_plan_spec.rb +0 -222
- data/spec/models/copy_to_spec.rb +0 -48
- data/spec/models/create_domain_request_spec.rb +0 -36
- data/spec/models/create_sub_account_request_spec.rb +0 -36
- data/spec/models/create_suppression_request_hard_bounce_inner_spec.rb +0 -36
- data/spec/models/create_suppression_request_manual_inner_spec.rb +0 -36
- data/spec/models/create_suppression_request_spam_complaint_inner_spec.rb +0 -36
- data/spec/models/create_suppression_request_spec.rb +0 -54
- data/spec/models/create_suppression_request_unsubscribe_inner_spec.rb +0 -36
- data/spec/models/create_webhook_request_spec.rb +0 -120
- data/spec/models/delete_response_spec.rb +0 -42
- data/spec/models/delete_sub_account_response_spec.rb +0 -42
- data/spec/models/delete_suppression200_response_inner_spec.rb +0 -42
- data/spec/models/delete_suppression_request_spec.rb +0 -36
- data/spec/models/delete_webhook_response_spec.rb +0 -42
- data/spec/models/device_spec.rb +0 -36
- data/spec/models/domain_dkim_spec.rb +0 -48
- data/spec/models/domain_dmarc_spec.rb +0 -48
- data/spec/models/domain_gpt_spec.rb +0 -48
- data/spec/models/domain_return_path_spec.rb +0 -48
- data/spec/models/domain_spec.rb +0 -150
- data/spec/models/domain_spf_spec.rb +0 -48
- data/spec/models/domain_track_spec.rb +0 -48
- data/spec/models/eip_spec.rb +0 -36
- data/spec/models/email_address_spec.rb +0 -42
- data/spec/models/email_message_from_spec.rb +0 -42
- data/spec/models/email_message_object_spec.rb +0 -120
- data/spec/models/email_message_reply_to_spec.rb +0 -42
- data/spec/models/email_message_spec.rb +0 -138
- data/spec/models/email_message_to_inner_bcc_inner_spec.rb +0 -48
- data/spec/models/email_message_to_inner_cc_inner_spec.rb +0 -48
- data/spec/models/email_message_to_inner_spec.rb +0 -60
- data/spec/models/email_message_with_template_spec.rb +0 -138
- data/spec/models/email_response_spec.rb +0 -60
- data/spec/models/email_stats_spec.rb +0 -42
- data/spec/models/email_stats_stats_spec.rb +0 -96
- data/spec/models/event_metadata_spec.rb +0 -84
- data/spec/models/event_spec.rb +0 -150
- data/spec/models/geo_location_spec.rb +0 -60
- data/spec/models/ip_allocation_request_spec.rb +0 -42
- data/spec/models/ip_deletion_response_spec.rb +0 -42
- data/spec/models/ip_pool_create_request_spec.rb +0 -66
- data/spec/models/ip_pool_delete_response_spec.rb +0 -42
- data/spec/models/ip_pool_spec.rb +0 -108
- data/spec/models/ip_pool_update_request_spec.rb +0 -54
- data/spec/models/ip_spec.rb +0 -168
- data/spec/models/ip_update_request_spec.rb +0 -36
- data/spec/models/label_spec.rb +0 -48
- data/spec/models/member_spec.rb +0 -102
- data/spec/models/message_header_to_spec.rb +0 -60
- data/spec/models/message_spec.rb +0 -210
- data/spec/models/message_to_spec.rb +0 -60
- data/spec/models/operating_system_spec.rb +0 -60
- data/spec/models/person_spec.rb +0 -42
- data/spec/models/recipient_spec.rb +0 -60
- data/spec/models/smtp_auth_spec.rb +0 -60
- data/spec/models/stat_spec.rb +0 -42
- data/spec/models/stat_stat_spec.rb +0 -96
- data/spec/models/stat_stats_spec.rb +0 -96
- data/spec/models/sub_account_spec.rb +0 -130
- data/spec/models/suppression_spec.rb +0 -60
- data/spec/models/third_party_sending_provider_spec.rb +0 -96
- data/spec/models/update_sub_account_spec.rb +0 -36
- data/spec/models/update_webhook_spec.rb +0 -120
- data/spec/models/user_agent_spec.rb +0 -54
- data/spec/models/webhook_spec.rb +0 -144
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#SendPost API
|
|
3
3
|
|
|
4
|
-
## Introduction SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS.
|
|
4
|
+
## Introduction > ### 📌 API versioning & the v1 response contract > > This reference documents the **v1 response contract** — the stable, camelCase > response shape that SendPost commits to. This is the shape you should build against. > > **During the current deprecation window**, requests authenticated with an account > or sub-account API key receive the **legacy** response shape by default, so existing > integrations keep working unchanged. To receive the documented v1 shape today, send: > > ``` > X-SendPost-Public-Contract: v1 > ``` > > **How to tell which shape you got.** Every public response echoes the applied > contract in the `X-SendPost-Public-Contract` response header. While the legacy > shape is being served, responses also carry standard deprecation signals: > `Deprecation: true`, a `Sunset` header with the exact cut-over date, and a > `Link: <...>; rel=\"deprecation\"` header pointing at the migration guide. **Read the > `Sunset` header for the authoritative end date** rather than hardcoding one. > > **After the sunset date**, v1 becomes the default and the legacy shape is no longer > served. New integrations should send `X-SendPost-Public-Contract: v1` now and rely on > the shapes in this reference. SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS. # API Contract Versioning (Public REST) The public REST API uses a versioned response contract so field changes stay non-breaking: * Send `X-SendPost-Public-Contract: v1` to opt into the current v1 response shape, or `legacy` for the pre-v1 shape. If the header is omitted, the applied contract is policy-driven — `legacy` before the published sunset date, `v1` after it. * Every response echoes `X-SendPost-Public-Contract: <applied>`. When the `legacy` contract is served, responses also include `Deprecation: true`, `Sunset: <RFC1123 date>`, and `Link: <doc-url>; rel=\"deprecation\"`. * Migrate to `v1` before the sunset date. Notable legacy → v1 field changes: Suppression `smtp_error` → `smtpError`, Stat `email_type` → `emailType`. > `X-SendPost-Private-Api: true` is an internal header used only by the SendPost dashboard to receive richer internal objects. It is not part of the public SDK contract and should not be set by API integrations.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.13.0
|
|
@@ -20,7 +20,7 @@ module Sendpost
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Send Email
|
|
23
|
-
# Use
|
|
23
|
+
# Send transactional or marketing emails to one or multiple recipients. This is the primary endpoint for all email sending through SendPost. **Capabilities:** - **Single Email**: Send to one recipient with full personalization - **Batch Sending**: Send to up to 500 recipients in a single API call - **Personalization**: Use Handlebars templating (`{{variableName}}`) in subject, HTML body, and text body - **Attachments**: Include base64-encoded files (max 25MB total per request) - **Tracking**: Enable/disable open and click tracking per email - **IP Pool Routing**: Route emails through specific IP pools **Common Use Cases:** | Use Case | Example | |----------|---------| | Order Confirmation | Send receipt with order details after purchase | | Password Reset | Time-sensitive security email with reset link | | Welcome Email | Onboard new users with personalized greeting | | Shipping Notification | Update customers when orders ship | | Invoice/Receipt | Attach PDF invoices to billing emails | **Personalization Example:** ```json { \"to\": [{ \"email\": \"john@example.com\", \"customFields\": { \"firstName\": \"John\", \"orderTotal\": \"$99.99\" } }], \"subject\": \"Hi {{firstName}}, your order is confirmed!\", \"htmlBody\": \"<p>Thanks {{firstName}}! Your total: {{orderTotal}}</p>\" } ``` **Test Email Addresses:** SendPost provides special test email addresses for testing webhooks and events without sending real emails: | Test Email | Behavior | |------------|----------| | `test@playwithsendpost.io` | Generates delivered event, then simulates opens and clicks after a few seconds | | `deliver@playwithsendpost.io` | Generates delivered event only (no opens/clicks) | | `hardbounce@playwithsendpost.io` | Always generates a hard bounce event | | `softbounce@playwithsendpost.io` | Always generates a soft bounce event | | `dropped@playwithsendpost.io` | Always generates a dropped event (SMTPDropped) | **Self-Test Email (Send to Yourself):** Use `hello@playwithsendpost.io` as the **from** address to send emails to yourself for testing: - **Sender**: Must be `hello@playwithsendpost.io` - **Recipient**: Must be your account owner email (the email you used to sign up) - **Behavior**: Real email delivery to your inbox (no domain verification required, no mock mode) - **Use Case**: Test your API integration by sending real emails to yourself without domain setup **Example:** ```json { \"from\": {\"email\": \"hello@playwithsendpost.io\"}, \"to\": [{\"email\": \"your-account-email@example.com\"}], \"subject\": \"Test Email to Myself\", \"htmlBody\": \"<p>This is a test email to myself</p>\" } ``` This will send a real email to your inbox that you can actually receive and open. **Note**: If you send to any email other than your account email, the request will be rejected with an error. **Using Test Emails:** - Simply send to any test email address like a normal recipient - Mock mode is automatically enabled for test emails - All events trigger webhooks normally - Events are marked as mock messages but follow the same structure as real events - Perfect for testing webhook integrations without using real email addresses **Example:** ```json { \"to\": [{\"email\": \"test@playwithsendpost.io\"}], \"from\": {\"email\": \"sender@example.com\"}, \"subject\": \"Test Email\", \"htmlBody\": \"<p>This is a test</p>\" } ``` This will generate: Sent → Delivered → Opened (after 2-5s) → Clicked (after 1-3s more) **Response:** Returns an array of responses, one per recipient, each containing: - `messageId` - Unique ID for tracking - `submittedAt` - Timestamp of acceptance - `errorCode` and `message` - Status information
|
|
24
24
|
# @param email_message_object [EmailMessageObject] Email message details
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [Array<EmailResponse>]
|
|
@@ -30,7 +30,7 @@ module Sendpost
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Send Email
|
|
33
|
-
# Use
|
|
33
|
+
# Send transactional or marketing emails to one or multiple recipients. This is the primary endpoint for all email sending through SendPost. **Capabilities:** - **Single Email**: Send to one recipient with full personalization - **Batch Sending**: Send to up to 500 recipients in a single API call - **Personalization**: Use Handlebars templating (`{{variableName}}`) in subject, HTML body, and text body - **Attachments**: Include base64-encoded files (max 25MB total per request) - **Tracking**: Enable/disable open and click tracking per email - **IP Pool Routing**: Route emails through specific IP pools **Common Use Cases:** | Use Case | Example | |----------|---------| | Order Confirmation | Send receipt with order details after purchase | | Password Reset | Time-sensitive security email with reset link | | Welcome Email | Onboard new users with personalized greeting | | Shipping Notification | Update customers when orders ship | | Invoice/Receipt | Attach PDF invoices to billing emails | **Personalization Example:** ```json { \"to\": [{ \"email\": \"john@example.com\", \"customFields\": { \"firstName\": \"John\", \"orderTotal\": \"$99.99\" } }], \"subject\": \"Hi {{firstName}}, your order is confirmed!\", \"htmlBody\": \"<p>Thanks {{firstName}}! Your total: {{orderTotal}}</p>\" } ``` **Test Email Addresses:** SendPost provides special test email addresses for testing webhooks and events without sending real emails: | Test Email | Behavior | |------------|----------| | `test@playwithsendpost.io` | Generates delivered event, then simulates opens and clicks after a few seconds | | `deliver@playwithsendpost.io` | Generates delivered event only (no opens/clicks) | | `hardbounce@playwithsendpost.io` | Always generates a hard bounce event | | `softbounce@playwithsendpost.io` | Always generates a soft bounce event | | `dropped@playwithsendpost.io` | Always generates a dropped event (SMTPDropped) | **Self-Test Email (Send to Yourself):** Use `hello@playwithsendpost.io` as the **from** address to send emails to yourself for testing: - **Sender**: Must be `hello@playwithsendpost.io` - **Recipient**: Must be your account owner email (the email you used to sign up) - **Behavior**: Real email delivery to your inbox (no domain verification required, no mock mode) - **Use Case**: Test your API integration by sending real emails to yourself without domain setup **Example:** ```json { \"from\": {\"email\": \"hello@playwithsendpost.io\"}, \"to\": [{\"email\": \"your-account-email@example.com\"}], \"subject\": \"Test Email to Myself\", \"htmlBody\": \"<p>This is a test email to myself</p>\" } ``` This will send a real email to your inbox that you can actually receive and open. **Note**: If you send to any email other than your account email, the request will be rejected with an error. **Using Test Emails:** - Simply send to any test email address like a normal recipient - Mock mode is automatically enabled for test emails - All events trigger webhooks normally - Events are marked as mock messages but follow the same structure as real events - Perfect for testing webhook integrations without using real email addresses **Example:** ```json { \"to\": [{\"email\": \"test@playwithsendpost.io\"}], \"from\": {\"email\": \"sender@example.com\"}, \"subject\": \"Test Email\", \"htmlBody\": \"<p>This is a test</p>\" } ``` This will generate: Sent → Delivered → Opened (after 2-5s) → Clicked (after 1-3s more) **Response:** Returns an array of responses, one per recipient, each containing: - `messageId` - Unique ID for tracking - `submittedAt` - Timestamp of acceptance - `errorCode` and `message` - Status information
|
|
34
34
|
# @param email_message_object [EmailMessageObject] Email message details
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(Array<EmailResponse>, Integer, Hash)>] Array<EmailResponse> data, response status code and response headers
|
|
@@ -88,7 +88,7 @@ module Sendpost
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Send Email With Template
|
|
91
|
-
#
|
|
91
|
+
# Send emails using pre-configured templates stored in SendPost. Templates separate email content from code, enabling: **Benefits:** - Update email content without code deployments - Marketing teams can manage templates independently - Consistent branding across all applications - A/B test different template versions **How It Works:** 1. Create templates in the SendPost dashboard with Handlebars variables 2. Reference the template by name or ID in this API call 3. Pass dynamic data through recipient `customFields` 4. SendPost merges data with template and sends **Common Use Cases:** | Template Type | Dynamic Data | |---------------|--------------| | Welcome Email | `firstName`, `accountType`, `loginUrl` | | Order Receipt | `orderNumber`, `items`, `total`, `shippingAddress` | | Password Reset | `resetLink`, `expiryTime`, `userName` | | Weekly Digest | `articleList`, `unreadCount`, `userName` | **Example Request:** ```json { \"from\": { \"email\": \"orders@yourstore.com\" }, \"to\": [{ \"email\": \"customer@example.com\", \"customFields\": { \"firstName\": \"Sarah\", \"orderNumber\": \"ORD-2024-001\", \"totalAmount\": \"$149.99\" } }], \"template\": \"order-confirmation-v2\" } ``` **Note:** Template variables not provided in `customFields` will render as empty strings.
|
|
92
92
|
# @param email_message_with_template [EmailMessageWithTemplate] Email message details with template information
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @return [Array<EmailResponse>]
|
|
@@ -98,7 +98,7 @@ module Sendpost
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Send Email With Template
|
|
101
|
-
#
|
|
101
|
+
# Send emails using pre-configured templates stored in SendPost. Templates separate email content from code, enabling: **Benefits:** - Update email content without code deployments - Marketing teams can manage templates independently - Consistent branding across all applications - A/B test different template versions **How It Works:** 1. Create templates in the SendPost dashboard with Handlebars variables 2. Reference the template by name or ID in this API call 3. Pass dynamic data through recipient `customFields` 4. SendPost merges data with template and sends **Common Use Cases:** | Template Type | Dynamic Data | |---------------|--------------| | Welcome Email | `firstName`, `accountType`, `loginUrl` | | Order Receipt | `orderNumber`, `items`, `total`, `shippingAddress` | | Password Reset | `resetLink`, `expiryTime`, `userName` | | Weekly Digest | `articleList`, `unreadCount`, `userName` | **Example Request:** ```json { \"from\": { \"email\": \"orders@yourstore.com\" }, \"to\": [{ \"email\": \"customer@example.com\", \"customFields\": { \"firstName\": \"Sarah\", \"orderNumber\": \"ORD-2024-001\", \"totalAmount\": \"$149.99\" } }], \"template\": \"order-confirmation-v2\" } ``` **Note:** Template variables not provided in `customFields` will render as empty strings.
|
|
102
102
|
# @param email_message_with_template [EmailMessageWithTemplate] Email message details with template information
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @return [Array<(Array<EmailResponse>, Integer, Hash)>] Array<EmailResponse> data, response status code and response headers
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#SendPost API
|
|
3
3
|
|
|
4
|
-
## Introduction SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS.
|
|
4
|
+
## Introduction > ### 📌 API versioning & the v1 response contract > > This reference documents the **v1 response contract** — the stable, camelCase > response shape that SendPost commits to. This is the shape you should build against. > > **During the current deprecation window**, requests authenticated with an account > or sub-account API key receive the **legacy** response shape by default, so existing > integrations keep working unchanged. To receive the documented v1 shape today, send: > > ``` > X-SendPost-Public-Contract: v1 > ``` > > **How to tell which shape you got.** Every public response echoes the applied > contract in the `X-SendPost-Public-Contract` response header. While the legacy > shape is being served, responses also carry standard deprecation signals: > `Deprecation: true`, a `Sunset` header with the exact cut-over date, and a > `Link: <...>; rel=\"deprecation\"` header pointing at the migration guide. **Read the > `Sunset` header for the authoritative end date** rather than hardcoding one. > > **After the sunset date**, v1 becomes the default and the legacy shape is no longer > served. New integrations should send `X-SendPost-Public-Contract: v1` now and rely on > the shapes in this reference. SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending. You can use SendPost to: * Send personalised emails to multiple recipients using email API * Track opens and clicks * Analyse statistics around open, clicks, bounce, unsubscribe and spam At and advanced level you can use it to: * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers * Classify your emails using groups for better analysis * Analyse and fix email sending at sub-account level, IP Pool level or group level * Have automated alerts to notify disruptions regarding email sending * Manage different dedicated IP Pools so to better control your email sending * Automatically know when IP or domain is blacklisted or sender score is down * Leverage pro deliverability tools to get significantly better email deliverability & inboxing [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e) # Overview ## REST API SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform: * **GET**- to get a resource * **POST** - to create a resource * **PUT** - to update an existing resource * **DELETE** - to delete a resource The API endpoint for all API calls is: <code>https://api.sendpost.io/api/v1</code> Some conventions that have been followed in the API design overall are following: * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint. * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp. <aside class=\"success\"> All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header. </aside> SendPost uses conventional HTTP response codes to indicate the success or failure of an API request. * Codes in the <code>2xx</code> range indicate success. * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc. * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance ) <aside class=\"info\"> SendPost all responses return <code>created</code> in UNIX nano epoch timestamp. </aside> ## Authentication SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register). SendPost expects the API key to be included in all API requests to the server in a header that looks like the following: `X-SubAccount-ApiKey: AHEZEP8192SEGH` This API key is used for all Sub-Account level operations such as: * Sending emails * Retrieving stats regarding open, click, bounce, unsubscribe and spam * Uploading suppressions list * Verifying sending domains and more In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as : * Creating and managing sub-accounts * Allocating IPs for your account * Getting overall billing and usage information * Email List validation * Creating and managing alerts and more <aside class=\"notice\"> You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code> </aside> In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost. ## HTTP Response Headers Code | Reason | Details ---------------| -----------------------| ----------- 200 | Success | Everything went well 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code> 403 | Forbidden | Typically sent when resource with same name or details already exist 406 | Missing resource id | Resource id specified is either missing or doesn't exist 422 | Unprocessable entity | Request body is not in proper format 500 | Internal server error | Some error happened at SendPost while processing API request 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later # API SDKs We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io** * [PHP](https://github.com/sendpost/sendpost_php_sdk) * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk) * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk) * [Python](https://github.com/sendpost/sendpost_python_sdk) * [Golang](https://github.com/sendpost/sendpost_go_sdk) # API Reference SendX REST API can be broken down into two major sub-sections: * Sub-Account * Account Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call. The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours. # SMTP Reference Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendPost's delivery at scale for your SMTP needs. ## Integrating SMTP 1. Get the SMTP `username` and `password` from your SendPost account. 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay. 3. Set the `username` and `password`. 4. Set the port to `587` (or as specified below). ## SMTP Ports - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`. - For a SSL connection, use port `465` - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints. SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt). To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally. <aside class=\"success\"> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. </aside> ## Sending email from your application ```javascript \"use strict\"; const nodemailer = require(\"nodemailer\"); async function main() { // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: \"smtp.sendpost.io\", port: 587, secure: false, // true for 465, false for other ports auth: { user: \"<username>\" , // generated ethereal user pass: \"<password>\", // generated ethereal password }, requireTLS: true, debug: true, logger: true, }); // send mail with defined transport object try { let info = await transporter.sendMail({ from: 'erlich@piedpiper.com', to: 'gilfoyle@piedpiper.com', subject: 'Test Email Subject', html: '<h1>Hello Geeks!!!</h1>', }); console.log(\"Message sent: %s\", info.messageId); } catch (e) { console.log(e) } } main().catch(console.error); ``` For PHP ```php <?php // Import PHPMailer classes into the global namespace use PHPMailer\\PHPMailer\\PHPMailer; use PHPMailer\\PHPMailer\\SMTP; use PHPMailer\\PHPMailer\\Exception; // Load Composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); // Settings try { $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = '<username>'; // SMTP username $mail->Password = '<password>'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('erlich@piedpiper.com', 'Erlich'); $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\"; } ``` For Python ```python #!/usr/bin/python3 import sys import os import re from smtplib import SMTP import ssl from email.mime.text import MIMEText SMTPserver = 'smtp.sendpost.io' PORT = 587 sender = 'erlich@piedpiper.com' destination = ['gilfoyle@piedpiper.com'] USERNAME = \"<username>\" PASSWORD = \"<password>\" # typical values for text_subtype are plain, html, xml text_subtype = 'plain' content=\"\"\"\\ Test message \"\"\" subject=\"Sent from Python\" try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver, PORT) conn.ehlo() context = ssl.create_default_context() conn.starttls(context=context) # upgrade to tls conn.ehlo() conn.set_debuglevel(True) conn.login(USERNAME, PASSWORD) try: resp = conn.sendmail(sender, destination, msg.as_string()) print(\"Send Mail Response: \", resp) except Exception as e: print(\"Send Email Error: \", e) finally: conn.quit() except Exception as e: print(\"Error:\", e) ``` For Golang ```go package main import ( \"fmt\" \"net/smtp\" \"os\" ) // Sending Email Using Smtp in Golang func main() { username := \"<username>\" password := \"<password>\" from := \"erlich@piedpiper.com\" toList := []string{\"gilfoyle@piedpiper.com\"} host := \"smtp.sendpost.io\" port := \"587\" // recommended // This is the message to send in the mail msg := \"Hello geeks!!!\" // We can't send strings directly in mail, // strings need to be converted into slice bytes body := []byte(msg) // PlainAuth uses the given username and password to // authenticate to host and act as identity. // Usually identity should be the empty string, // to act as username. auth := smtp.PlainAuth(\"\", username, password, host) // SendMail uses TLS connection to send the mail // The email is sent to all address in the toList, // the body should be of type bytes, not strings // This returns error if any occured. err := smtp.SendMail(host+\":\"+port, auth, from, toList, body) // handling the errors if err != nil { fmt.Println(err) os.Exit(1) } fmt.Println(\"Successfully sent mail to all user in toList\") } ``` For Java ```java // implementation 'com.sun.mail:javax.mail:1.6.2' import java.util.Properties; import javax.mail.Message; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SMTPConnect { // This address must be verified. static final String FROM = \"erlich@piedpiper.com\"; static final String FROMNAME = \"Erlich Bachman\"; // Replace recipient@example.com with a \"To\" address. If your account // is still in the sandbox, this address must be verified. static final String TO = \"gilfoyle@piedpiper.com\"; // Replace smtp_username with your SendPost SMTP user name. static final String SMTP_USERNAME = \"<username>\"; // Replace smtp_password with your SendPost SMTP password. static final String SMTP_PASSWORD = \"<password>\"; // SMTP Host Name static final String HOST = \"smtp.sendpost.io\"; // The port you will connect to on SendPost SMTP Endpoint. static final int PORT = 587; static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\"; static final String BODY = String.join( System.getProperty(\"line.separator\"), \"<h1>SendPost SMTP Test</h1>\", \"<p>This email was sent with SendPost using the \", \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\", \" for <a href='https://www.java.com'>Java</a>.\" ); public static void main(String[] args) throws Exception { // Create a Properties object to contain connection configuration information. Properties props = System.getProperties(); props.put(\"mail.transport.protocol\", \"smtp\"); props.put(\"mail.smtp.port\", PORT); props.put(\"mail.smtp.starttls.enable\", \"true\"); props.put(\"mail.smtp.debug\", \"true\"); props.put(\"mail.smtp.auth\", \"true\"); // Create a Session object to represent a mail session with the specified properties. Session session = Session.getDefaultInstance(props); // Create a message with the specified information. MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(FROM,FROMNAME)); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO)); msg.setSubject(SUBJECT); msg.setContent(BODY,\"text/html\"); // Create a transport. Transport transport = session.getTransport(); // Send the message. try { System.out.println(\"Sending...\"); // Connect to SendPost SMTP using the SMTP username and password you specified above. transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD); // Send the email. transport.sendMessage(msg, msg.getAllRecipients()); System.out.println(\"Email sent!\"); } catch (Exception ex) { System.out.println(\"The email was not sent.\"); System.out.println(\"Error message: \" + ex.getMessage()); System.out.println(ex); } // Close and terminate the connection. } } ``` Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write. We have provided examples in Python3, Golang, Java, PHP, JS. # API Contract Versioning (Public REST) The public REST API uses a versioned response contract so field changes stay non-breaking: * Send `X-SendPost-Public-Contract: v1` to opt into the current v1 response shape, or `legacy` for the pre-v1 shape. If the header is omitted, the applied contract is policy-driven — `legacy` before the published sunset date, `v1` after it. * Every response echoes `X-SendPost-Public-Contract: <applied>`. When the `legacy` contract is served, responses also include `Deprecation: true`, `Sunset: <RFC1123 date>`, and `Link: <doc-url>; rel=\"deprecation\"`. * Migrate to `v1` before the sunset date. Notable legacy → v1 field changes: Suppression `smtp_error` → `smtpError`, Stat `email_type` → `emailType`. > `X-SendPost-Private-Api: true` is an internal header used only by the SendPost dashboard to receive richer internal objects. It is not part of the public SDK contract and should not be set by API integrations.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.3.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.13.0
|
|
@@ -20,7 +20,7 @@ module Sendpost
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Allocate IP
|
|
23
|
-
#
|
|
23
|
+
# Request allocation of a new dedicated IP address to your account. New IPs start in warmup state to build sender reputation gradually. **Warmup Process:** - New IPs have limited daily sending capacity - Volume increases automatically each day while `autoWarmupEnabled` is set - Full capacity typically reached after 30-45 days - Consistent, engagement-positive sending accelerates warmup **When to Allocate New IPs:** - Scaling beyond current IP capacity - Separating different email streams (transactional vs marketing) - Geographic IP requirements - Replacing an IP with poor reputation **Best Practices:** - Dedicated IPs require consistent volume (10k+ emails/month ideal) - Low volume on dedicated IPs can harm deliverability - Consider shared IPs for low-volume senders
|
|
24
24
|
# @param ip_allocation_request [IPAllocationRequest]
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [IP]
|
|
@@ -30,7 +30,7 @@ module Sendpost
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Allocate IP
|
|
33
|
-
#
|
|
33
|
+
# Request allocation of a new dedicated IP address to your account. New IPs start in warmup state to build sender reputation gradually. **Warmup Process:** - New IPs have limited daily sending capacity - Volume increases automatically each day while `autoWarmupEnabled` is set - Full capacity typically reached after 30-45 days - Consistent, engagement-positive sending accelerates warmup **When to Allocate New IPs:** - Scaling beyond current IP capacity - Separating different email streams (transactional vs marketing) - Geographic IP requirements - Replacing an IP with poor reputation **Best Practices:** - Dedicated IPs require consistent volume (10k+ emails/month ideal) - Low volume on dedicated IPs can harm deliverability - Consider shared IPs for low-volume senders
|
|
34
34
|
# @param ip_allocation_request [IPAllocationRequest]
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(IP, Integer, Hash)>] IP data, response status code and response headers
|
|
@@ -88,8 +88,8 @@ module Sendpost
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Delete IP
|
|
91
|
-
#
|
|
92
|
-
# @param ip_id [Integer] The ID of the IP resource to delete
|
|
91
|
+
# Remove an IP address from your account. This action is irreversible. **⚠️ Before Deleting:** - Remove the IP from all IP pools first - Ensure no active sending relies on this IP - Consider impact on overall sending capacity **Note:** You cannot delete an IP that is currently assigned to an IP pool.
|
|
92
|
+
# @param ip_id [Integer] The unique ID of the IP resource to delete.
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @return [IPDeletionResponse]
|
|
95
95
|
def delete_ip(ip_id, opts = {})
|
|
@@ -98,8 +98,8 @@ module Sendpost
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Delete IP
|
|
101
|
-
#
|
|
102
|
-
# @param ip_id [Integer] The ID of the IP resource to delete
|
|
101
|
+
# Remove an IP address from your account. This action is irreversible. **⚠️ Before Deleting:** - Remove the IP from all IP pools first - Ensure no active sending relies on this IP - Consider impact on overall sending capacity **Note:** You cannot delete an IP that is currently assigned to an IP pool.
|
|
102
|
+
# @param ip_id [Integer] The unique ID of the IP resource to delete.
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @return [Array<(IPDeletionResponse, Integer, Hash)>] IPDeletionResponse data, response status code and response headers
|
|
105
105
|
def delete_ip_with_http_info(ip_id, opts = {})
|
|
@@ -151,11 +151,11 @@ module Sendpost
|
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
# List IPs
|
|
154
|
-
#
|
|
154
|
+
# Retrieve all IP addresses allocated to your account. IPs are the foundation of your sending infrastructure and directly impact deliverability. **IP Types:** | Type | Value | Description | |------|-------|-------------| | Shared | `0` | IP shared with other SendPost senders. Cost-effective, reputation is pooled. | | Dedicated | `1` | Exclusive IP for your account. Full control over sender reputation. | **IP States:** | State | Value | Description | |-------|-------|-------------| | Warmup | `0` | New IP building reputation. Volume is limited and gradually increases. | | Normal | `1` | Fully warmed IP ready for normal sending volume. | **Warmup Information:** - `autoWarmupEnabled` - Whether SendPost is automatically increasing volume **Use Cases:** - Monitor IP warmup progress for new IPs - Audit shared vs dedicated IP allocation - Plan IP pool configurations - Check available sending capacity
|
|
155
155
|
# @param [Hash] opts the optional parameters
|
|
156
|
-
# @option opts [Integer] :limit Number of records to return per request
|
|
157
|
-
# @option opts [Integer] :offset Number of initial records to skip
|
|
158
|
-
# @option opts [String] :search Case insensitive search against
|
|
156
|
+
# @option opts [Integer] :limit Number of records to return per request. Default 20. (default to 20)
|
|
157
|
+
# @option opts [Integer] :offset Number of initial records to skip for pagination. (default to 0)
|
|
158
|
+
# @option opts [String] :search Case insensitive search against public IP addresses.
|
|
159
159
|
# @return [Array<IP>]
|
|
160
160
|
def get_all_ips(opts = {})
|
|
161
161
|
data, _status_code, _headers = get_all_ips_with_http_info(opts)
|
|
@@ -163,11 +163,11 @@ module Sendpost
|
|
|
163
163
|
end
|
|
164
164
|
|
|
165
165
|
# List IPs
|
|
166
|
-
#
|
|
166
|
+
# Retrieve all IP addresses allocated to your account. IPs are the foundation of your sending infrastructure and directly impact deliverability. **IP Types:** | Type | Value | Description | |------|-------|-------------| | Shared | `0` | IP shared with other SendPost senders. Cost-effective, reputation is pooled. | | Dedicated | `1` | Exclusive IP for your account. Full control over sender reputation. | **IP States:** | State | Value | Description | |-------|-------|-------------| | Warmup | `0` | New IP building reputation. Volume is limited and gradually increases. | | Normal | `1` | Fully warmed IP ready for normal sending volume. | **Warmup Information:** - `autoWarmupEnabled` - Whether SendPost is automatically increasing volume **Use Cases:** - Monitor IP warmup progress for new IPs - Audit shared vs dedicated IP allocation - Plan IP pool configurations - Check available sending capacity
|
|
167
167
|
# @param [Hash] opts the optional parameters
|
|
168
|
-
# @option opts [Integer] :limit Number of records to return per request
|
|
169
|
-
# @option opts [Integer] :offset Number of initial records to skip
|
|
170
|
-
# @option opts [String] :search Case insensitive search against
|
|
168
|
+
# @option opts [Integer] :limit Number of records to return per request. Default 20. (default to 20)
|
|
169
|
+
# @option opts [Integer] :offset Number of initial records to skip for pagination. (default to 0)
|
|
170
|
+
# @option opts [String] :search Case insensitive search against public IP addresses.
|
|
171
171
|
# @return [Array<(Array<IP>, Integer, Hash)>] Array<IP> data, response status code and response headers
|
|
172
172
|
def get_all_ips_with_http_info(opts = {})
|
|
173
173
|
if @api_client.config.debugging
|
|
@@ -217,8 +217,8 @@ module Sendpost
|
|
|
217
217
|
end
|
|
218
218
|
|
|
219
219
|
# Get IP
|
|
220
|
-
#
|
|
221
|
-
# @param ip_id [Integer] The ID of the IP resource to retrieve
|
|
220
|
+
# Retrieve detailed information about a specific IP address, including its warmup status, type, and configuration. **Use Cases:** - Check warmup progress for a new dedicated IP - Verify IP configuration before adding to a pool - Debug deliverability issues by checking IP state - Monitor auto-warmup progress
|
|
221
|
+
# @param ip_id [Integer] The unique ID of the IP resource to retrieve.
|
|
222
222
|
# @param [Hash] opts the optional parameters
|
|
223
223
|
# @return [IP]
|
|
224
224
|
def get_specific_ip(ip_id, opts = {})
|
|
@@ -227,8 +227,8 @@ module Sendpost
|
|
|
227
227
|
end
|
|
228
228
|
|
|
229
229
|
# Get IP
|
|
230
|
-
#
|
|
231
|
-
# @param ip_id [Integer] The ID of the IP resource to retrieve
|
|
230
|
+
# Retrieve detailed information about a specific IP address, including its warmup status, type, and configuration. **Use Cases:** - Check warmup progress for a new dedicated IP - Verify IP configuration before adding to a pool - Debug deliverability issues by checking IP state - Monitor auto-warmup progress
|
|
231
|
+
# @param ip_id [Integer] The unique ID of the IP resource to retrieve.
|
|
232
232
|
# @param [Hash] opts the optional parameters
|
|
233
233
|
# @return [Array<(IP, Integer, Hash)>] IP data, response status code and response headers
|
|
234
234
|
def get_specific_ip_with_http_info(ip_id, opts = {})
|
|
@@ -280,9 +280,9 @@ module Sendpost
|
|
|
280
280
|
end
|
|
281
281
|
|
|
282
282
|
# Update IP
|
|
283
|
-
#
|
|
283
|
+
# Modify settings for an existing IP address. Use this to manage warmup configuration. **Configurable Settings:** - `autoWarmupEnabled` - Enable/disable automatic warmup schedule **Use Cases:** - Pause auto-warmup during low-volume periods - Re-enable warmup after manual intervention - Adjust warmup settings based on sending patterns
|
|
284
284
|
# @param ip_update_request [IPUpdateRequest]
|
|
285
|
-
# @param ip_id [Integer] The ID of the IP resource to update
|
|
285
|
+
# @param ip_id [Integer] The unique ID of the IP resource to update.
|
|
286
286
|
# @param [Hash] opts the optional parameters
|
|
287
287
|
# @return [IP]
|
|
288
288
|
def update_ip(ip_update_request, ip_id, opts = {})
|
|
@@ -291,9 +291,9 @@ module Sendpost
|
|
|
291
291
|
end
|
|
292
292
|
|
|
293
293
|
# Update IP
|
|
294
|
-
#
|
|
294
|
+
# Modify settings for an existing IP address. Use this to manage warmup configuration. **Configurable Settings:** - `autoWarmupEnabled` - Enable/disable automatic warmup schedule **Use Cases:** - Pause auto-warmup during low-volume periods - Re-enable warmup after manual intervention - Adjust warmup settings based on sending patterns
|
|
295
295
|
# @param ip_update_request [IPUpdateRequest]
|
|
296
|
-
# @param ip_id [Integer] The ID of the IP resource to update
|
|
296
|
+
# @param ip_id [Integer] The unique ID of the IP resource to update.
|
|
297
297
|
# @param [Hash] opts the optional parameters
|
|
298
298
|
# @return [Array<(IP, Integer, Hash)>] IP data, response status code and response headers
|
|
299
299
|
def update_ip_with_http_info(ip_update_request, ip_id, opts = {})
|