Sms integration
Is it possible to integrate sms API, to send sms after save successfully a resource
useForm or useShow to trigger the SMS API call upon a successful operation.useForm hook to call your SMS API.useForm hook:@refinedev/supabase@refinedev/strapi-v4successNotificationsuccessNotificationsuccessNotificationsuccessNotificationsuccessNotificationsuccessNotificationNotificationProviderimport { useForm } from "@refinedev/core";
import axios from "axios";
const MyComponent = () => {
const { formProps, saveButtonProps } = useForm({
successNotification: async (data, values, resource) => {
// Customize the success notification
const message = `Successfully created ${data.title}`;
// Call your SMS API here
try {
await axios.post('<https://your-sms-api.com/send',> {
to: 'recipient-phone-number',
message: message,
});
} catch (error) {
console.error("Failed to send SMS:", error);
}
return {
message: message,
description: "good job!",
type: "success",
};
},
});
return (
<form {...formProps}>
{/* Your form fields here */}
<button {...saveButtonProps}>Save</button>
</form>
);
};