How to Send Emails In Next.JS 14 With Dynamic Templates
ฝัง
- เผยแพร่เมื่อ 1 มิ.ย. 2024
- In this video I am going to show you how we can send emails in a Next.js 14 project. I also show you how we can create dynamic HTML templates in a way that we can embed our custom data in them.
GitHub Repo (Pleas Give it ⭐ on GitHub) :github.com/vahid-nejad/nextjs...
Any Super Thanks Will Be Appreciated 🙏❤️
Helpful Will try
Excellent work Sakura !! ❤❤
Thank you so much 🙏🙏😊
Very usefull, Thanks for sharing
Thank you so much 🙏
thanks... that works very well! ;) I only had to refactor the server action into its own file because my form sits in a client component! It might be that I accidently send you an email once ;)
Very Helpful
I am glad it was helpful 🙏
Thank you so much, Bro! I was looking for a solution to send a simple email, and this is the best one I've found. Keep creating more informative videos!
Glad it helped! ❤️❤️
Great video, thank you so much 😊
Glad you enjoyed it!
Great video and so helpful thank you.
You are so welcome!
Excellent video thank you!
Glad you enjoyed it!
@@SakuraDev I changed the output: "export" in next.config.js for static export html files. But when i take files to the nginx server the form submission failed and nodemailer is not working. I've used different method in route.ts. But locally it is working fine. In Response 405 METHOD not allowed is show. I guess api route is not working in static export.
Hey Sakura can you please make some node and express stuff.
Whatever you teaches directly goes into my head.
Hey 👋 thanks, what content do you like?
Kinda like best practices 😅
I've been working on implementing email functionality in my Next.js 14 project, and I ran into some issues. It turns out, the bug was simply caused by me using the wrong email address! Silly mistake, but your tutorial really helped me sort it out. Thank you!
Sounds great!
Thanks
Thanks 🙏🙏
excellent content brother
Thanks 🙏🙏
Could you please provide a production-grade TypeScript version of a MERN user management system using Prisma ORM? The system should include features such as user registration, account verification, login functionality, two-factor authentication (2FA), password recovery/reset using Nodemailer, role-based access control (RBAC) where an admin can manage users, including the ability to ban/unban them. Additionally, the system should utilize http-only cookies, access tokens, and refresh tokens. The frontend should be implemented with Redux Toolkit and include an interceptor. It would be great to see how an experienced developer like you would approach building this. Thanks in advance!
i would like you to create a video, where a user fills in a form after that, the use receives an email that says the form has been sent and the form data going to a different email
I will upload it soon 🔜
@@SakuraDevyes... really need one. I tried one and it says "use server" can't be used in the client component.
if you understand this much then you dont know how to use it? 😮
Sir ! It is exactly what I was looking for, thank you for your effort. but instead of a template as an attachment , I need to generate a pdf file and send it to the email. How can you help me?
Thanks, well maybe in the next video
@@SakuraDev Thank you in advance sir, I will appreciate it.
Thank you bro, but I have a issue the mail i send are going to spam box not inbox, please help how do i fix it
I can't get it to work. When I press the button, nothing happens except in the console I get:
"ReferenceError: setImmediate is not defined"
Wow! btw please how can I install bun on my windows laptop
Hey 👋, it's still under development for windows.
Very good content!!, but how to make an attachement? like a pdf file!
Coming soon!
teach how to use next auth and axios interceptors to deal with refresh token using the new next 14
Hi, I have a video about it in next js 13. You can use that solution on nextjs 14 as well.
th-cam.com/video/RPl0r-Yl6pU/w-d-xo.html
hi, can show how to send email with file upload?
Hi, yes you can . I will create a short video for that
i'vee used but why handlebars import types error always send email failed why ?
Hi, Do you have trouble with importing the handlebars or your problem is something else?
is nodemailer completely free ?
i want to use it in my real projects.
Yes it is free
@@SakuraDev thank you Mr. Sakura. really helpful 😃
hi mr@@SakuraDev ,
Is there a return value that can be given?
so that I can find out whether the email delivery succeeded or failed?
handlebars gives error in version 14 due to webpack.
Hey, just delete the node modules and then run npm i, it solved the problem for me
@@SakuraDev Ok. I'll try both bun install and npm install. Let's see what works
Hi @@SakuraDev , tried deleting the node_module and running npm i. I still get those warnings. Is there any other way to solve this?
nice🫰
Thanks 🔥
All of this works nicely, but I getting this warning/error for handlebars; anyone else? Any idea how to fix? Solutions on the net didn't work (adapting next.config.mjs); weird you are not getting this as well:
require.extensions is not supported by webpack. Use a loader instead.
Import trace for requested module:
./node_modules/handlebars/lib/index.js
./app/components/auth_components/SignUpCard.js
Seeing this error and I try to find the solution but can't get it
next-dev.js?3515:32 ./node_modules/nodemailer/lib/dkim/index.js:10:0
Module not found: Can't resolve 'fs'
same do you have a solution?
@@Sasuke-kc6dw No how about you?
@@Sasuke-kc6dw But I'm now using resend
The function for sending email should be called on server only not on client,