Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Add the ability to specify SNS origination number when publishing #5033

Closed
2 tasks done
wh1337 opened this issue Dec 29, 2023 · 5 comments
Closed
2 tasks done
Assignees

Comments

@wh1337
Copy link
Contributor

wh1337 commented Dec 29, 2023

🔖 Feature description

Currently, the publish command for SNS looks like the following:
(https://github.com/novuhq/novu/blob/next/providers/sns/src/lib/sns.provider.ts#L31)

  const publish = new PublishCommand({
    PhoneNumber: to,
    Message: content,
  });

It is my recommendation that a new field be added in the configuration: Origination Number.

This will allow users to assign a particular integration in Novu with a specified number from AWS SNS.

Potential code solution:

...
let publishCommand: PublishCommand;

if (this.config.originationNumber) {
      publishCommand = new PublishCommand({
      PhoneNumber: to,
      Message: content,
      MessageAttributes: {
          'AWS.SNS.SMS.SenderID': {
            DataType: 'String',
            StringValue: this.config.originationNumber // Specify your origination number here
          }
        }
    });
} else {
// existing publish command
      publishCommand = new PublishCommand({
        PhoneNumber: to,
        Message: content,
      });
}

const snsResponse = await this.client.send(publishCommand);
...

Research:
https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sns/command/PublishCommand/

🎤 Why is this feature needed ?

In my use-case, we use 1 number to send out general ambulance assignments and communications. We use another number to send out emergency communications.

✌️ How do you aim to achieve this?

Add a new option in the UI/API that will allow users to input their origination number. If set, it will add that number to the configuration. This would be optional so there would be no downtime on upgrades for existing implementations.

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@wh1337
Copy link
Contributor Author

wh1337 commented Dec 31, 2023

I'm willing to create this PR if assigned and the solution is acceptable.

@wh1337
Copy link
Contributor Author

wh1337 commented Jan 13, 2024

Update: On hold for a moment, I am waiting for AWS Support to finish the registration of a new Toll Free number to be used during testing and validation (locally). Will update once that is completed.

@scopsy
Copy link
Contributor

scopsy commented Jan 22, 2024

Thank you @wh1337 🙏

@wh1337
Copy link
Contributor Author

wh1337 commented Jan 23, 2024

Update: Still waiting. AWS has up to 14 business days to complete the registration request. Apologies for the delay.

@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants