I have tried using SMTP settings as displayed in the docs, also tried using the payload/email-nodemailer plugin and also sendmailer-sendgrid plugin
But even with defaultfromaddress provided the email sent do not have from address and the emails get rejected immediately.
+1
in version
beta-29its making from header like:
name <name>instead of correctone:
name <email>btw same bugs have resend adapter
I updated all the way till beta 45
With no luck
Did you find a fix for this?
yeah, for now set defaultFromAddress and defaultFromName to email
Let me give it a try
Thanks that actually works
I just now saw the PR for the same two
Not sure how I missed it
That works thank you
Quick question the verify link shows a 404 error when clicked, is it broken as well?
Or is there an additional setting or something that is missing in the documentation
yeah
u can custom it
my code in users collection:
auth: {
tokenExpiration: 60 * 60 * 24,
verify: {
generateEmailHTML: async ({ req, token, user }) => {
const url = `${process.env.NEXT_PUBLIC_SERVER_URL}/auth/verify?token=${token}`
console.log('URL', url)
const email = SendRegisterEmailTemplate({ email: user.email, url })
const ReactDOMServer = (await import('react-dom/server')).default
return ReactDOMServer.renderToString(email);
// return `Hey ${user.email}, verify your email by clicking here: ${url}`
},
},
forgotPassword: {
generateEmailHTML: async ({ req, token, user }: any) => {
const url = `${process.env.NEXT_PUBLIC_SERVER_URL}/auth/reset-password?token=${token}`
console.log('URL', url)
// return `Hey ${user.email}, reset your password by clicking here: ${url}`
const email = SendVerifyEmailTemplate({ email: user.email, url })
const ReactDOMServer = (await import('react-dom/server')).default
return ReactDOMServer.renderToString(email);
},
},
maxLoginAttempts: 5,
lockTime: 600 * 1000
},u returning html in these functions
in my code im building it from react component
Thank you 🙏, I will give it a try and get back to you
sorry I was on my phone so couldn't see the code, but that is what I am using as well more or less, but I was talking about the verification link itself, is /verify or /auth/verify a default and do I gotta set it somewhere cause when I use this link for example
http://localhost:3000/auth/verify?token=6139102fe089c883481fc47398398369ac3e7b10it returns an 404 error
Yes
U must make a page
And then call API reset password
With token
Pass
And pass confirm
okay but what api? I is it the users api?
and what do pass exactly just the token?
I am sorry the documentation was not very clear on these things
sorry never mind I seem to have missed that it was clearly documented here
https://payloadcms.com/docs/authentication/operationsAnyways thanks for all the help
No problem
Star
Discord
online
Get dedicated engineering support directly from the Payload team.