Sms integration
Is it possible to integrate sms API, to send sms after save successfully a resource
5 Replies
Hi @Sly. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, it is possible to integrate an SMS API to send an SMS after successfully saving a resource in a refine application. You can achieve this by using the
successNotification
property in hooks like useForm
or useShow
to trigger the SMS API call upon a successful operation.
Here is an example of how you can customize the successNotification
to send an SMS using an SMS API like Twilio:
1. Set up the Notification Provider: Ensure you have the NotificationProvider
set up in your application. This is required for the successNotification
property to work.
2. Customize the successNotification
: Use the successNotification
property in the useForm
hook to call your SMS API.
Here is a code example using the useForm
hook:
In this example, after a successful form submission, the successNotification
function is called. Inside this function, you can make an API call to your SMS service to send a notification.
For more details on customizing notifications, you can refer to the useForm documentation (https://refine.dev/docs/data/hooks/use-form/#successnotification-) and the Notification Providers guide (https://refine.dev/docs/guides-concepts/notifications/#notification-providers).
If you need to set up Twilio for SMS, you can follow the guide on OTP Authentication with Supabase and Twilio in React (https://refine.dev/blog/supabase-twilio-otp-authentication-in-react/#set-up-the-supabase-project) for detailed instructions on configuring Twilio.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1172098337760096258> kapa.ai is still learning and improving, please let us know how it did by reacting below
ratty-blushOP•6mo ago
@kapa.ai can I use Supabase and Strapi in the same project?
Let me check the knowledge base for you. One moment! :books:
----------------------
Yes, you can use both Supabase and Strapi in the same refine project. Refine allows you to use multiple data providers, which means you can integrate different backends within the same application.
Here is how you can set up both Supabase and Strapi in your refine project:
1. Install the necessary packages:
- For Supabase:
@refinedev/supabase
- For Strapi: @refinedev/strapi-v4
2. Create clients for both Supabase and Strapi:
- Set up the Supabase client in src/utility/supabaseClient.ts
:
- Set up the Strapi client in src/utility/strapiClient.ts
:
3. Configure the data providers in your App
component:
4. Use the data providers in your components:
- When using hooks like useList
, useShow
, useCreate
, etc., you can specify which data provider to use by passing the resource
parameter:
By following these steps, you can successfully integrate both Supabase and Strapi in the same refine project. For more details on data providers, you can refer to the Data Provider documentation (https://refine.dev/docs/data/data-provider/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1172098337760096258> kapa.ai is still learning and improving, please let us know how it did by reacting below