/*** Handler that will be called during the execution of a PostUserRegistration flow.* * @param {Event} event - Details about the context and user that has registered. * @param {PostUserRegistrationAPI} api - Interface whose methods can be used to change the behavior of post user registration. */exports.onExecutePostUserRegistration = async (event, api) => { const { IncomingWebhook } = require("@slack/webhook"); const webhook = new IncomingWebhook(event.secrets.SLACK_WEBHOOK_URL); const text = `New User: ${event.user.email}`; const channel = '#some_channel'; webhook.send({ text, channel });};
/*** Handler that will be called during the execution of a PostUserRegistration flow.* * @param {Event} event - Details about the context and user that has registered.* @param {PostUserRegistrationAPI} api - Interface whose methods can be used to change the behavior of post user registration.*/const axios = require("axios");exports.onExecutePostUserRegistration = async (event, api) => { await axios.post("https://my-api.exampleco.com/users", { params: { email: event.user.email }});};