Zapier automates tasks but you can also use it to offload some of the mundane programming tasks for you as you build your next big SaaS.
Say you want to send a welcome email when a new user registers an account. You could use nodemailer to set the emails up yourself BUUT why not just get Zapier to do it for you.
Here's what we will do:
Step 1: Set up Zapier zap
Step 2: Call the hook when an event happens in-app
const axios = require('axios');
export const notifyWebhook = async (url, body) => {
const res = await axios
.post(url, body, {
Accept: "application/json",
"Content-Type": "application/json"
})
}
notifyWebhook("https://hooks.zapier.com/hooks/catch/9539273/bds3d2n", {user: "[email protected]", message: "Trigger Webhook event"});
Step 3: Profit $$$
You can now trigger the event from in-app and use the object passed in as dynamic values for the zap action.
For example, in the above case, I can send the email address and the message to send an email to.