Add message text logging to SMS webhook handler
- Log the message text for regular SMS: "Received text" with text content - Log "Received image" for MMS messages without the content - Includes masked phone number and message ID in both cases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,10 +46,13 @@ async function handleInbound(body: unknown, deps: WebhookSmsRouterDeps) {
|
||||
|
||||
// MMS check
|
||||
if (hasMedia) {
|
||||
logger.info({ event: 'sms.received_image', from: maskPhone(from), messageId }, 'Received image');
|
||||
await sendSms(from, to, SMS_TEMPLATES.MMS_NOT_SUPPORTED());
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info({ event: 'sms.received_text', from: maskPhone(from), text, messageId }, 'Received text');
|
||||
|
||||
// Rate limit
|
||||
const maxPerHour = parseInt(process.env.SMS_RATE_LIMIT_PER_HOUR || '10', 10);
|
||||
if (!checkSmsRateLimit(phoneHash, maxPerHour)) {
|
||||
|
||||
Reference in New Issue
Block a user