Hi,
I am exploring the Forms (Early feature).
Can any one guide me how to add another action in Form->Flows->Action
like there some inbuilt functions given e.g. send mail using sendgrid.
But if We have configured SES as external mail provider then how can we add another action there send mail using SES
Step 1: Set Up AWS SES
-
Verify your email addresses: Ensure that you have verified the email addresses or domains you plan to use in SES.
-
Obtain your AWS credentials: You’ll need your AWS Access Key ID and Secret Access Key.
Step 2: Create a Lambda Function for Sending Email via SES
-
Go to the AWS Lambda console.
-
Create a new function.
-
Choose “Author from scratch.”
-
Assign a name to your function and select a runtime, such as Node.js or Python.
-
Attach the AmazonSESFullAccess policy to the Lambda execution role to allow sending emails via SES.
Write the Lambda Function Code:
Here is an example using Node.js:
const AWS = require('aws-sdk');
AWS.config.update({ region: 'us-east-1' });
exports.handler = async (event) => {
const ses = new AWS.SES();
const params = {
Destination: {
ToAddresses: [event.toEmail],
},
Message: {
Body: {
Text: { Data: event.body },
},
Subject: { Data: event.subject },
},
Source: event.fromEmail,
};
try {
const data = await ses.sendEmail(params).promise();
console.log(data);
return { statusCode: 200, body: JSON.stringify(data) };
} catch (error) {
console.error(error);
return { statusCode: 500, body: JSON.stringify(error) };
}
};
Step 3: Set Up API Gateway
Create a new API:
- Go to the API Gateway console.
- Create a new REST API.
Create a Resource and Method:
- Create a new resource.
- Add a POST method to this resource.
Integrate the Method with Lambda:
- Select Lambda Function as the integration type.
- Enter your Lambda function name.
Deploy the API:
- Deploy the API to a stage.
- Note down the invoke URL, as you’ll need it to call this endpoint.
Step 4: Add Custom Action in Form Flow
Configure your Form Action to Use the API Gateway Endpoint:
- In your form flow configuration, add a custom action.
- Use the API Gateway endpoint URL to make a POST request.
Example Configuration:
- Assuming you’re using a system like Zapier, Integromat, or a custom backend:
{
"action": "custom",
"url": "https://your-api-id.execute-api.us-east-1.amazonaws.com/your-stage/your-resource",
"method": "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"toEmail": "{{email}}",
"fromEmail": "your-verified-email@example.com",
"subject": "Your Subject Here",
"body": "Your email body here"
}
}
Step 5: Test Your Integration
- Submit the Form: Ensure that the form data triggers the action.
- Check SES: Verify that the email was sent via SES and received by the recipient.
By following these steps, you can configure your custom action to send emails using AWS SES in your Form Flows. GMSocrates This process involves creating a Lambda function to handle the email sending logic, setting up an API Gateway to expose the function, and configuring your form to call this API.
Hi @atul.gupta2,
Welcome to the Auth0 Community!
Yes, that’s correct. There are some built-in actions for Forms. However, they do not include one for sending mail using SES.
Currently, there are only built-in actions for sending mail using SendGrid and Mailjet.
If you need to send mail using SES, you might need to write your own custom action form.
For example, you could create an HTTP request action in your flow to make a request to send mail using SES:
For a guide on constructing the request, I would refer to the Amazon SES API docs.
Keep me posted on how this goes for you.
Thanks,
Rueben
Hi @Lorena783lopez,
Thanks for helping on this one!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
Hi There!
We are excited to announce the availability of the Flows Auth0 Send Email Action!
This new feature streamlines how you communicate with users by allowing you to send emails directly from Flows using the Email Provider already configured in your Auth0 Tenant.
Key Highlights
- Unified Configuration: Say goodbye to redundant setups. You can now leverage your existing Tenant Email Provider settings directly within Flows without extra configuration effort.
- Enhanced Flexibility: We have included support for Custom Email Providers, giving you full control over your email delivery infrastructure.
- Dynamic Customization: The action supports a variety of settings, including custom variables and Liquid Syntax, allowing for highly personalized email templates.
Resources
Ready to streamline your email logic? Check out the documentation below to learn more:
We’d love to hear how you plan to use this in your workflows.
Thanks!
Dawid
