"use client"; import { useState } from "react"; import Link from "next/link"; import { COMPANY, SMS_SENDER, SUPPORT_EMAIL } from "../legal-config"; /** * Public SMS opt-in web form for A2P 10DLC campaign verification. Contains every * element Twilio/CTIA require: phone field, an un-pre-checked consent checkbox, a * description of the messages, frequency, rates disclaimer, HELP/STOP instructions, * and links to the Terms and Privacy Policy. */ export default function SmsOptInPage() { const [phone, setPhone] = useState(""); const [consent, setConsent] = useState(false); const [done, setDone] = useState(false); const digits = phone.replace(/\D/g, ""); const valid = digits.length >= 10 && consent; function onSubmit(e: React.FormEvent) { e.preventDefault(); if (!valid) return; // Records the opt-in. Consent + timestamp should be persisted server-side for your // records; this confirmation is the user-facing acknowledgement. setDone(true); } return (

{COMPANY} SMS Alerts

Sign up to receive text messages from {COMPANY}.

At {COMPANY}, we send text messages to help you use and secure your account. By opting in below you'll receive account and service messages, including:

{done ? (
You're signed up.{" "}We'll text account and service messages to {phone}. Reply STOP{" "}at any time to unsubscribe, or HELP{" "}for help.
) : (
setPhone(e.target.value)} required />
{/* Consent checkbox — MUST NOT be pre-checked (starts false). */}
setConsent(e.target.checked)} />

Message frequency varies. Message and data rates may apply. Reply{" "} HELP{" "}for help or STOP{" "}to cancel at any time. Carriers are not liable for delayed or undelivered messages.

)}

Program details

How to opt out or get help

Reply STOP{" "}to any message to unsubscribe — you'll get one confirmation and no further texts. Reply HELP{" "}for help, or contact us at {SUPPORT_EMAIL} {SMS_SENDER ? <> or {SMS_SENDER} : null}. Messages are sent from {COMPANY}.

Your privacy

We do not sell, rent, or share your mobile phone number or your SMS opt-in consent with any third parties or affiliates for their marketing purposes. {" "} See our Privacy Policy{" "}for full details.

); }