Hook.Notifier is a notification collector, it allows you to send, store and organize useful notifications on your phone from various services.Check Hook.Notifier official website
The no-code way
We are going to realize a contact form system without e-mail. The goal will be to receive our contact requests directly on our phone. We consider in this tutorial that you already have Strapi configured to receive your contact form submissions.
Go to your Strapi administration interface. Here is the Contact entity that we created on our side. Of course, do what you want, ask for the information you need.
Then simply go to Settings > Webhooks in your Strapi backoffice.
- Create a webhook, fill in the Name that suits you and in the Url field insert your HookNotifier url:
— Replace the parameters
key by yours. You can of course add all the parameters you want to customize your notifications, see the HookNotifier documentation.
— Note that your parameters must be in an “url encoded” format to be functional, as in the example above. You can use this website to make your conversions.
- Tick Create checkbox in front of Entry
That’s all! You should receive a notification when a new entry is created. You can try now by creating an entry directly in your Strapi’s interface.
Strapi automatically inserts all the data from the entries inside the HookNotifier notifications. Click on your notification to see the content.
The just a bit of code way
The big concern with the above method is that we cannot distinguish the entities for which we want notifications, unfortunately Strapi’s webhooks are very rudimentary, which implies
in the above example that we will receive notifications for all the entities created through our Strapi and not just the contacts.
With this method, we will not only be able to be more precise, but it will allow you to trigger any type of notification according to your needs.
Let’s include in our contact entity lifecycle a ping to HookNotifier to send a notification.
You can note here that I have included variables in the notification parameters.
Of course, with this method, you can add calls anywhere in your Strapi API. Simple and efficient!
If you like this article, feel free to connect with us on Twitter.
If you have any questions or special requests, such as needing clarification on the terms discussed in this article, more information on a specific part, or additional articles and tutorials, please feel free to provide feedback through the widget below.