{"id":616,"date":"2019-01-11T10:35:48","date_gmt":"2019-01-11T10:35:48","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=616"},"modified":"2019-01-11T10:41:23","modified_gmt":"2019-01-11T10:41:23","slug":"amazon-sns-setup-for-https-and-email","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/amazon-sns-setup-for-https-and-email\/","title":{"rendered":"Amazon SNS setup for HTTPS and Email"},"content":{"rendered":"<p><span style=\"color: #0000ff;\">Login to AWS Console<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Goto Simple Notification Service<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Create a Topic<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Add a Subscription &#8211; the easy and safe way to do this is by clicking the ARN of the Topic (in the topic listing page ) and going to the Topic details page.<\/span><\/p>\n<figure id=\"attachment_620\" aria-describedby=\"caption-attachment-620\" style=\"width: 604px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-620 size-large\" src=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details-1024x473.png\" alt=\"\" width=\"604\" height=\"279\" srcset=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details-1024x473.png 1024w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details-300x138.png 300w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details-768x355.png 768w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Topic-Details.png 1343w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-620\" class=\"wp-caption-text\">Topic Details<\/figcaption><\/figure>\n<figure id=\"attachment_617\" aria-describedby=\"caption-attachment-617\" style=\"width: 895px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Create-Subscription.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-617 size-full\" src=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Create-Subscription.png\" alt=\"\" width=\"895\" height=\"349\" srcset=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Create-Subscription.png 895w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Create-Subscription-300x117.png 300w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Create-Subscription-768x299.png 768w\" sizes=\"auto, (max-width: 895px) 100vw, 895px\" \/><\/a><figcaption id=\"caption-attachment-617\" class=\"wp-caption-text\">Subscription Protocols<\/figcaption><\/figure>\n<p><span style=\"color: #0000ff;\">Choose your subscription protocol (in simpler words in which way you want the notifications to be delivered)<\/span><\/p>\n<figure id=\"attachment_618\" aria-describedby=\"caption-attachment-618\" style=\"width: 899px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Protocols.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-618 size-full\" src=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Protocols.png\" alt=\"\" width=\"899\" height=\"385\" srcset=\"https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Protocols.png 899w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Protocols-300x128.png 300w, https:\/\/www.kolkataonweb.com\/code-bank\/wp-content\/uploads\/2019\/01\/Amazon-SNS-Protocols-768x329.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/a><figcaption id=\"caption-attachment-618\" class=\"wp-caption-text\">Subscription Protocols<\/figcaption><\/figure>\n<p><span style=\"color: #0000ff;\">Amazon SNS will do a verification. The method depends on the protocol chosen. For example for emails it will send an email with a verification link, for HTTP or HTTPS it will call the endpoint with some data like below. On opening or hitting the <span style=\"color: #333333;\">SubscribeURL<span style=\"color: #0000ff;\"> the verification will be complete. <\/span><\/span><\/span><\/p>\n<pre class='wp-code-highlight prettyprint'>Array\r\n(\r\n[Type] =&gt; SubscriptionConfirmation\r\n[MessageId] =&gt; eeexxxea-xxxx-xxxx-xxxx-c15xxxx81361\r\n[Token] =&gt; 2336412f3xxxxxxxxxxxxxxxxxxxxxxxxee34aadbb4eb9c926c288f8ca1xxxxxxxxxxxxcbe27c6835edd47bd28d0cf1d0cb9b4xxxxxxxx1003b95c6bc1231db657b1bb465a7d98c73a8d79faddb473a1a109c45654a1db1f11xxxxxxxxxxxxxxxxxxxf74dae61acfbe2f508901390b2cd6\r\n[TopicArn] =&gt; arn:aws:sns:us-east-x:0xxxxxxxxxx9:xxx-bounce\r\n[Message] =&gt; You have chosen to subscribe to the topic arn:aws:sns:us-east-x:0xxxxxxxxxx9:xxx-bounce.\r\nTo confirm the subscription, visit the SubscribeURL included in this message.\r\n[SubscribeURL] =&gt; https:\/\/sns.us-east-1.amazonaws.com\/?Action=ConfirmSubscription&amp;TopicArn=arn:aws:sns:us-east-x:0xxxxxxxxxx9:xxx-bounce&amp;Token=2336412f3xxxxxxxxxxxxxxxxxxxxxxxxee34aadbb4eb9c926c288f8ca1xxxxxxxxxxxxcbe27c6835edd47bd28d0cf1d0cb9b4xxxxxxxx1003b95c6bc1231db657b1bb465a7d98c73a8d79faddb473a1a109c45654a1db1f11xxxxxxxxxxxxxxxxxxxf74dae61acfbe2f508901390b2cd6\r\n[Timestamp] =&gt; 2019-01-09T14:53:31.247Z\r\n[SignatureVersion] =&gt; 1\r\n[Signature] =&gt; euyT80G1NujWgQMWfltxxxxxxxxxxxxxxxiDqeicbE1FH5dwdBnAA7UY84zHf0fsJCd\/xxxxxxxxxxxxxxxxxxxxxxxxx\/rxx\/t\/wKxxxxxx\/LKg2QwcjGPdnIh4xp6rNA4PKihOjMiPfTZYH4kQV+h+4zqFsQT1UL+ixlM+xBZqZY3zUV1lrHKz+SfIkPJxxxxxxxxxxIB2FN0O2leokHJYRlUqxxxxxxkMzlbsMg4ChDW8+hcJ14hNEz5kpM5T0Fqljt2CmqkF1BQ68ViTgFV7yYpcSTbejo0DuZAUxxxxxxxxxx5y340TcfTWWq+3hKSTtB9aTclgDchvLDYKNqg==\r\n[SigningCertURL] =&gt; https:\/\/sns.us-east-x.amazonaws.com\/SimpleNotificationService-ac56xxxxxxxxxxxxxxxxxxxx8aa1d9b.pem\r\n)<\/pre>\n<p><span style=\"color: #0000ff;\">Once the verification is complete the Subscription ID will show an ARN. See The Topic Details picture.<\/span><\/p>\n<p>Sample PHP code for auto-verification of SNS Subscriptions for HTTP\/HTTPS protocols <a href=\"https:\/\/www.kolkataonweb.com\/code-bank\/php\/php-code-for-amazon-sns-auto-subscription-confirmation-https\/\">PHP code for Amazon SNS Auto Subscription Confirmation (HTTPS)<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Login to AWS Console Goto Simple Notification Service Create a Topic Add a Subscription &#8211; the easy and safe way to do this is by clicking the ARN of the Topic (in the topic listing page ) and going to the Topic details page. Choose your subscription protocol (in simpler words in which way you&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/amazon-sns-setup-for-https-and-email\/\">Continue reading <span class=\"screen-reader-text\">Amazon SNS setup for HTTPS and Email<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,3],"tags":[147,146,141,148,149],"class_list":["post-616","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","category-php","tag-amazon-aws","tag-amazon-sns","tag-php","tag-simple-notification-services","tag-sns","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=616"}],"version-history":[{"count":3,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/616\/revisions"}],"predecessor-version":[{"id":624,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/616\/revisions\/624"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}