Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 7x 7x 7x 7x 7x 7x | import { SNSClient, PublishCommand } from '@aws-sdk/client-sns';
import { config } from 'dotenv';
config();
export async function sendSMS({ phoneNumber, message }: { phoneNumber: string; message: string }) {
const client = new SNSClient({ region: process.env.AWS_REGION });
const params = {
Message: message,
PhoneNumber: phoneNumber,
};
const command = new PublishCommand(params);
try {
const data = await client.send(command);
console.log('Success', data);
} catch (err) {
console.error('Error', err);
}
}
|