Comments (7)
I had also some problems and had to look at the AWS Lambda CloudWatch Insight Log to figure out the specific error, because "An unexpected error occurred" is not that helpful.
My first error was, that I used the wrong SENDER_ARN
(not the one from a whitelisted E-Mail address from AWS SES).
And the second error was, that I didn't had permission (in AWS Lambda) to send emails to the _to
address, although I verified it (as described in the README.md
). I fixed it by adding it explicitly to the serverless.yml
as additional iamRoleStatement
:
- Effect: "Allow"
Action:
- "ses:SendEmail"
Resource: ${file(config.json):RECIPIENT_ARN}
Hope that helps.
from formplug.
Hello @danielireson @hpawe01 🙂. I'm new to AWS and I'm trying to put this amazing serverless working. Hopefully, you can help me. First of all, thank you for your work and support.
I'm having An unexpected error occurred
. I checked the Cloudwatch logs and I have this weird error:
Here is part of my serverless.yml
:
And here is my completely simple contact form:
The SENDER_ARN
is the same as the whitelist email that I'm using.
I also tried adding the same RECIPIENT_ARN
to see if it solves but nothing.
What I am doing wrong?
Really thank you for your help ❤️
from formplug.
I am only a beneficiary of this service created by @danielireson
I don't see anything wrong with your configuration. In my ARNs the whole email address is behind the last /
though and in your ARNs it looks like it is only the domain? So are you sure that you use the correct ARNs of the email addresses configured in SES?
from formplug.
I am only a beneficiary of this service created by @danielireson
I don't see anything wrong with your configuration. In my ARNs the whole email address is behind the last
/
though and in your ARNs it looks like it is only the domain? So are you sure that you use the correct ARNs of the email addresses configured in SES?
You're amazing!! ❤️ I was using domain ARN instead of email ARN. Now it's working.
However, I have this last issue. I have the hidden _to
for the email I want to receive ([email protected]) and the _replyTo
for the visitor email. In the whitelist, I have my email ([email protected]).
But now Formplug is verifying _replyTo
if it is whitelisted `Non-whitelisted email in '_replyTo' field. How are you doing for your visitors to insert their email?
<input type="email" name="_replyTo" required />
<input type="text" name="message" required />
<input type="hidden" name="_to" value="[email protected]" />
Thank you!! 🙂
from formplug.
Glad I could help. I don't use this _replyTo
field so I don't know how this should work. Maybe @danielireson or someone else can help with this question.
from formplug.
Fixed by commenting this code on Request.js 😃 Thank you all!!
from formplug.
I'm going to close this as workarounds have been suggested.
It looks like there were a few different issues mentioned in this thread:
- The configuration for
WHITELISTED_RECIPIENTS
was previously set to an empty array inconfig.sample.json
by default. When creatingconfig.json
for your own deployment this value needed updating with whitelisted emails or removing. I've since changed the default so it's disabled to prevent this from happening. - There were IAM issues and a suggested fix was to add an extra "sendEmail" permisssion to allow
RECIPIENT_ARN
to send emails. I'm struggling to understand how this would have fixed anything as a recipient doesn't need to send emails. I think the fix is more likely to have been a byproduct of redeploying the service with an updated config, the wrong ARN values being used initially, or perhaps there's a small time delay when leaving SES sandbox mode (i.e. a delay after the AWS support ticket was closed). - There's a use-case for having non-whitelisted
_replyTo
emails but whitelisted_to
/_cc
/_bcc
emails that I haven't considered. The workaround here is to either disable whitelisting or accept the visitors email as a separate field (e.g. "visitorEmail") and then compose a new email in your email client when you want to reply. This is definitely more cumbersome and if this comes up in the future I'll look at changing how this works.
from formplug.
Related Issues (20)
- Checkboxes ignored HOT 2
- Multiple Email Addresses HOT 5
- Internal Server Error HOT 5
- Feature Request: Support for ReplyToAddress HOT 2
- Feature Request: Mailchimp integration HOT 1
- Feature Request : Conditionally switch FORM_Arn to route emails HOT 1
- _subject as an email subject? HOT 1
- google reCAPTCHA HOT 1
- How to limit form submission HOT 1
- Beginner Question HOT 1
- Missing authentication token HOT 10
- Attachments via S3? HOT 1
- Invalid _to recepient HOT 1
- Does not work with current lambda and won't deploy HOT 1
- reCaptcha to hCaptcha
- IP addresses and `localhost` are rejected as invalid in `_redirect`
- feature request: HTML-Mail
- Using other serverless provider
- Missing required request parameters: [format] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formplug.