Skip to content

Commit 299674b

Browse files
committed
deploy sms webhook
1 parent 0c2bdf3 commit 299674b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/routes/sms.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// https://www.twilio.com/docs/usage/webhooks/messaging-webhooks#incoming-message-webhook
2+
import { type ActionFunctionArgs } from '@remix-run/node'
3+
4+
export async function action({ request }: ActionFunctionArgs) {
5+
const body = new URLSearchParams(await request.text())
6+
7+
console.log(Object.fromEntries(body))
8+
9+
return new Response(
10+
`<?xml version="1.0" encoding="UTF-8"?><Response></Response>`,
11+
{ headers: { 'Content-Type': 'text/xml' } },
12+
)
13+
}

0 commit comments

Comments
 (0)