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

Send an SMS with text and media files. See the docs for more information

Created by paulkantak 913 days ago Viewed 9009 times
0
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
  mediaUrl: string[],
12
  from: string,
13
  to: string
14
) {
15
  const client = new Twilio(twilio.accountSid, twilio.token);
16
  const message = await client.messages.create({
17
    body: body,
18
    mediaUrl: mediaUrl,
19
    from: from,
20
    to: to,
21
  });
22
  return message;
23
}
24

Other submissions