-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG + FIX - Verification email uses defaultFromName instead of defaultFromEmail #225
Closed
Comments
Btw is there any way to make PR's to payload from outside the org? I'd happily raise a PR resolving this myself if possible. |
@mcornielje090404 you can absolutely make a PR directly to Payload by forking the main repo here. Check out our contributing guidelines for some extra info when it comes to opening a PR. I'll take a look at this issue too. |
3 tasks
3 tasks
JessChowdhury
added a commit
to payloadcms/payload
that referenced
this issue
May 21, 2024
## Description Closes [#225](payloadcms/payload-3.0-demo#225). The user verification emails are not being sent and this error is shown: ```ts APIError: Error sending email: 422 validation_error - Invalid `from` field. The email address needs to follow the `email@example.com` or `Name <email@example.com>` format. ``` The issue is resolved by updating the `from` property on the outgoing verification email: ```ts from: `"${email.defaultFromName}" <${email.defaultFromName}>`, // to from: `"${email.defaultFromName}" <${email. defaultFromAddress}>`, ``` **NOTE:** This was not broken in 2.0, see correct outgoing email [here](https://github.com/payloadcms/payload/blob/main/packages/payload/src/auth/sendVerificationEmail.ts#L69). - [X] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [X] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [X] Existing test suite passes locally with my changes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
I've been using the verify email flow from Payload and noticed that there's a bug with the way the verification email is sent.
When sending an email it is failing because the "address" used is the name passed into the email provider. This (in my use case) is causing Resend to block the email because it's not from a valid domain.
I've identified it to be in the file packages/payload/src/auth/sendVerificationEmail.ts
I believe you should just have to change the sendEmail function call at line 68 from
To:
The text was updated successfully, but these errors were encountered: