Question

A user can subscribe to topics with his email address, his phone number (SMS), etc.

Now, imagine he first subscribes to various topics by email, then later decides to add a telephone number for SMS.

Is there some method to keep subscriptions in sync, so that for all of his topics, he is subscribed with his email address and with his telephone number?

In other words: When the user subscribes to a topic, then his email address and his telephone number should be subscribed. When he adds a telephone number, then that number should be subscribed to all topics to which he is subscribed to by email. When he adds a new topic, he should be subscribed by email address and by telephone number. When he removes a topic, his email address and his telephone number should be unsubscribed. Etc.

Rough idea for a solution: Subscribe with a username, then associate email address, phone number, etc. with that username. Of course, this can be done manually with a separate user database outside of SNS. I am looking for a simple solution.

Was it helpful?

Solution

This is currently not supported by SNS. I recommend submitting this feature request to the SNS team on the SNS forums (https://forums.aws.amazon.com/forum.jspa?forumID=72).

Until then, you could implement this in your application by maintaining the data yourself and when the user adds a phone number you manually subscribe them to all the topics. Sadly they will get a subscribe notification for each of those topics.

OTHER TIPS

You are trying to make the platform do something it was never designed to do.

I am looking for a simple solution

There is only one solution, and that is for you to associate the email address and the phone number with the "username" on your service, in your database that runs your service, and manage the subscriptions, via your service... because SNS has no concept of the same subscriber getting the message via different delivery methods.

If I want both and SMS of the same message sent to me, that's 2 subscribers and 2 unassociated subscriptions to the SNS topic, not 1 subscription with 2 attributes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top