Skip to content

feat(6228): add aws sms integration#6427

Open
chadbrokaw wants to merge 2 commits into
mainfrom
6228/aws_sms_integration
Open

feat(6228): add aws sms integration#6427
chadbrokaw wants to merge 2 commits into
mainfrom
6228/aws_sms_integration

Conversation

@chadbrokaw

@chadbrokaw chadbrokaw commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR addresses #6228

  • Addresses the issue in full
  • Addresses only certain aspects of the issue

Description

  • Adds AWS End User Messaging (Pinpoint SMS Voice V2) as an alternative SMS provider alongside the existing Twilio integration
  • Provider is selected at runtime via a SMS_PROVIDER env var (twilio or aws); defaults to twilio so existing behavior is unchanged

How Can This Be Tested/Reviewed?

This is part 1 of the ticket and will need part 2 in order to be fully operable. For now, please inspect the code and ensure it looks good.

Author Checklist:

  • Added QA notes to the issue with applicable URLs
  • Reviewed in a desktop view
  • Reviewed in a mobile view
  • Reviewed considering accessibility
  • Added tests covering the changes
  • Made corresponding changes to the documentation
  • Ran yarn generate:client and/or created a migration when required

Review Process:

  • Read and understand the issue
  • Ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Either (1) explicitly ask a clarifying question, (2) request changes, or (3) approve the PR, even if there are very small remaining changes, if you don't need to re-review after the updates

@chadbrokaw chadbrokaw changed the title feat(6228): add awa sms integration feat(6228): add aws sms integration Jun 16, 2026
@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for partners-bloom-dev ready!

Name Link
🔨 Latest commit 2bc62a0
🔍 Latest deploy log https://app.netlify.com/projects/partners-bloom-dev/deploys/6a31d4c5911d3100087ab666
😎 Deploy Preview https://deploy-preview-6427--partners-bloom-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-angelopolis canceled.

Name Link
🔨 Latest commit 2bc62a0
🔍 Latest deploy log https://app.netlify.com/projects/bloom-angelopolis/deploys/6a31d4c54af0510008f5b51d

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-public-seeds ready!

Name Link
🔨 Latest commit 2bc62a0
🔍 Latest deploy log https://app.netlify.com/projects/bloom-public-seeds/deploys/6a31d4c55318470008af60d2
😎 Deploy Preview https://deploy-preview-6427--bloom-public-seeds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for bloom-exygy-dev ready!

Name Link
🔨 Latest commit 2bc62a0
🔍 Latest deploy log https://app.netlify.com/projects/bloom-exygy-dev/deploys/6a31d4c517741a000823aea3
😎 Deploy Preview https://deploy-preview-6427--bloom-exygy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an AWS End User Messaging (Pinpoint SMS Voice V2) SMS delivery path to the API as an alternative to the existing Twilio integration, selected via SMS_PROVIDER at runtime (defaulting to Twilio to preserve existing behavior).

Changes:

  • Introduces AWS Pinpoint SMS Voice V2 client support in SmsService, gated by SMS_PROVIDER=aws.
  • Adds unit tests covering both Twilio (default) and AWS provider initialization + send behavior.
  • Adds required dependency and documents new SMS-related env vars in the API .env.template.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/src/services/sms.service.ts Adds AWS client initialization and AWS send path alongside existing Twilio logic.
api/test/unit/services/sms.service.spec.ts New unit tests for Twilio default behavior and AWS provider behavior.
api/.env.template Documents SMS_PROVIDER and AWS SMS configuration env vars.
api/package.json Adds @aws-sdk/client-pinpoint-sms-voice-v2 dependency.
api/yarn.lock Locks new AWS SMS client and transitive dependencies.

Comment on lines +49 to +56
await this.awsClient.send(
new SendTextMessageCommand({
DestinationPhoneNumber: phoneNumber,
OriginationIdentity: process.env.AWS_SMS_ORIGINATION_NUMBER,
MessageBody: `Your Partners Portal account access token: ${singleUseCode}`,
MessageType: 'TRANSACTIONAL',
}),
);
Comment on lines 11 to +13
export class SmsService {
client: TwilioClient;
awsClient: PinpointSMSVoiceV2Client;
Comment thread api/package.json
"translations:sql": "ts-node scripts/generate-db-translation-sql.ts"
},
"dependencies": {
"@aws-sdk/client-pinpoint-sms-voice-v2": "^3.1003.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really confusing. According to this document pinpoint will no longer be supported. But it appears like the SDK is still the pinpoint one. So that isn't confusing at all

public constructor() {
if (process.env.TWILIO_ACCOUNT_SID && process.env.TWILIO_AUTH_TOKEN) {
if (process.env.SMS_PROVIDER === 'aws') {
if (process.env.AWS_SMS_REGION) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: It would be useful to add a WARN log here if the region is not defined but SMS provider is AWS.

): Promise<void> {
if (!this.client) {
return;
if (process.env.SMS_PROVIDER === 'aws') {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I'm cool with the way this is setup for this PR since we only have one use case for sending SMS messages. But when we get even one more use case it would be good to have just one function to call that sends the SMS no matter what SMS provider we have. A good example is how we are doing emails with the email-provider service.

But that can hold off to future PRs if you want to isolate that change

if (!this.client) {
return;
if (process.env.SMS_PROVIDER === 'aws') {
if (!this.awsClient) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here about logging. We should have a log that warns an SMS message was attempted but no client exists

@chadbrokaw chadbrokaw marked this pull request as ready for review June 22, 2026 22:30
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

Successfully merging this pull request may close these issues.

3 participants