0
Send SMS
One script reply has been approved by the moderators Verified

Send a simple text-only SMS. See the docs for more information

Created by armancedh2b 913 days ago Viewed 9390 times
1
Submitted by hugo697 Bun
Verified 423 days ago
1
import { Twilio } from "twilio";
2

3
type Twilio = {
4
  accountSid: string;
5
  token: string;
6
};
7

8
export async function main(
9
  twilio: Twilio,
10
  body: string,
11
  to: string,
12
  from: string
13
) {
14
  const client = new Twilio(twilio.accountSid, twilio.token);
15
  const message = await client.messages.create({
16
    body: body,
17
    to: to,
18
    from: from,
19
  });
20
  return message;
21
}
22

Other submissions