Investigate SMS delivery failure

The application reports successful message sending, but the user did not receive an SMS.  Further investigation is needed to determine the cause of the delivery failure.
This commit is contained in:
gpt-engineer-app[bot] 2025-02-26 22:23:54 +00:00
parent 777409e6cc
commit c4d3c70f8c

View file

@ -41,6 +41,21 @@ export function MessageComposer() {
}
console.log('Message stored successfully:', data);
// Call the Edge Function to send SMS
const { data: smsResponse, error: smsError } = await supabase.functions.invoke('send-sms', {
body: {
phoneNumber: formattedPhoneNumber,
message: message
}
});
if (smsError) {
console.error('SMS sending error:', smsError);
throw smsError;
}
console.log('SMS sent successfully:', smsResponse);
toast.success("Message sent successfully!");
setMessage("");
setPhoneNumber("");