From 54b5d8d43d187c4c67534357d443b71cf90348d5 Mon Sep 17 00:00:00 2001 From: Lola Date: Wed, 17 Jul 2024 19:35:06 -0500 Subject: [PATCH] implement maximum length for SMS notifications This prevents people from accidentally sending out a large amount of texts and racking up our Twilio bill --- src/pages/events/[event]/notification.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/events/[event]/notification.js b/src/pages/events/[event]/notification.js index 5fc78d7..3f86443 100644 --- a/src/pages/events/[event]/notification.js +++ b/src/pages/events/[event]/notification.js @@ -7,6 +7,8 @@ import {getSession} from "next-auth/react"; import {SendNotification, getEventQuery} from "./notification.gql" import {useFetcher, getFetcher} from "../../../fetch"; +const MAX_SMS_LENGTH = 280 + export default function Notification({event}) { const fetch = useFetcher(); const [emailSubject, setEmailSubject] = useState(''); @@ -36,14 +38,15 @@ export default function Notification({event}) { mb={2} />