How to Send Emails In Next.JS 14 With Dynamic Templates

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 78

  •  4 місяці тому

    Handlebars makes life easier! Thank you for this tutorial! Keep going! You're awesome!

    • @SakuraDev
      @SakuraDev  4 місяці тому

      Thank you so much! you're awesome too! 😄❤️

  • @gautamkrishna.m3431
    @gautamkrishna.m3431 8 місяців тому

    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!

    • @SakuraDev
      @SakuraDev  8 місяців тому

      Glad it helped! ❤️❤️

  • @unsignedchar000
    @unsignedchar000 3 місяці тому

    Nice video, thanks for sharing

    • @SakuraDev
      @SakuraDev  3 місяці тому

      Thanks 🙏, glad you liked it

  • @whezboo
    @whezboo 9 місяців тому +1

    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!

  • @guddisAlex
    @guddisAlex 11 місяців тому

    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 ;)

  • @moisespineda8520
    @moisespineda8520 5 місяців тому

    Thank you, try a lot of videos!!! but yours it really help me

    • @SakuraDev
      @SakuraDev  5 місяців тому

      I'm so glad to hear that my videos have been helpful for you! Your feedback means a lot to me. I'll keep making more content to support you and others. Thank you for watching! 😊🌟

  • @prashlovessamosa
    @prashlovessamosa Рік тому +2

    Hey Sakura can you please make some node and express stuff.
    Whatever you teaches directly goes into my head.

  • @sumonchandra5992
    @sumonchandra5992 Рік тому

    Excellent work Sakura !! ❤❤

    • @SakuraDev
      @SakuraDev  Рік тому

      Thank you so much 🙏🙏😊

  • @vbtux1
    @vbtux1 Рік тому

    Very usefull, Thanks for sharing

  • @watchnow4211
    @watchnow4211 Рік тому

    Helpful Will try

  • @techlightdev
    @techlightdev 9 місяців тому

    Great video and so helpful thank you.

    • @SakuraDev
      @SakuraDev  7 місяців тому

      You are so welcome!

  • @padmanabhmalwade2750
    @padmanabhmalwade2750 Рік тому

    Very Helpful

    • @SakuraDev
      @SakuraDev  Рік тому

      I am glad it was helpful 🙏

  • @AndresMartinez-se9zl
    @AndresMartinez-se9zl 4 місяці тому +1

    When i build the project i see this warning:
    ./node_modules/handlebars/lib/index.js
    require.extensions is not supported by webpack. Use a loader instead.
    What could i do?

    • @SakuraDev
      @SakuraDev  4 місяці тому

      hi, you can use the handlebars-loader for Webpack to handle Handlebars templates.
      Install the loader: npm install handlebars-loader --save-dev
      Then, update your Webpack config

  • @nirvanzentinal
    @nirvanzentinal 5 місяців тому

    Best

  • @clickadelic7681
    @clickadelic7681 7 місяців тому

    Great video, thank you so much 😊

    • @SakuraDev
      @SakuraDev  7 місяців тому

      Glad you enjoyed it!

  • @sirhc6chris1984
    @sirhc6chris1984 Рік тому

    excellent content brother

  • @anuj7286
    @anuj7286 11 місяців тому

    Excellent video thank you!

    • @SakuraDev
      @SakuraDev  10 місяців тому

      Glad you enjoyed it!

    • @anuj7286
      @anuj7286 10 місяців тому

      @@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.

  • @taifabeam
    @taifabeam Рік тому +2

    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

    • @SakuraDev
      @SakuraDev  Рік тому +3

      I will upload it soon 🔜

    • @OnlyJavascript
      @OnlyJavascript Рік тому

      ​@@SakuraDevyes... really need one. I tried one and it says "use server" can't be used in the client component.

    • @hollycow8171
      @hollycow8171 Рік тому

      if you understand this much then you dont know how to use it? 😮

  • @elanchezhianm8173
    @elanchezhianm8173 5 місяців тому

    Thanks bro

  • @Beemur
    @Beemur 10 місяців тому

    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"

  • @OnlyJavascript
    @OnlyJavascript Рік тому

    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!

  • @juniorsemerzier660
    @juniorsemerzier660 Рік тому +1

    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?

    • @SakuraDev
      @SakuraDev  Рік тому +2

      Thanks, well maybe in the next video

    • @juniorsemerzier660
      @juniorsemerzier660 Рік тому

      @@SakuraDev Thank you in advance sir, I will appreciate it.

  • @omokaroelliot1942
    @omokaroelliot1942 10 місяців тому

    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

  • @ekchills6948
    @ekchills6948 Рік тому

    Wow! btw please how can I install bun on my windows laptop

    • @SakuraDev
      @SakuraDev  Рік тому

      Hey 👋, it's still under development for windows.

  • @utkarshsharma1185
    @utkarshsharma1185 9 місяців тому

    Thanks

  • @codedusting
    @codedusting Рік тому

    handlebars gives error in version 14 due to webpack.

    • @SakuraDev
      @SakuraDev  Рік тому +1

      Hey, just delete the node modules and then run npm i, it solved the problem for me

    • @codedusting
      @codedusting Рік тому

      @@SakuraDev Ok. I'll try both bun install and npm install. Let's see what works

    • @tharishaperera9345
      @tharishaperera9345 10 місяців тому

      Hi @@SakuraDev , tried deleting the node_module and running npm i. I still get those warnings. Is there any other way to solve this?

  • @juniorsemerzier660
    @juniorsemerzier660 Рік тому

    Very good content!!, but how to make an attachement? like a pdf file!

  • @CodeLife05
    @CodeLife05 8 місяців тому

    i'vee used but why handlebars import types error always send email failed why ?

    • @SakuraDev
      @SakuraDev  8 місяців тому

      Hi, Do you have trouble with importing the handlebars or your problem is something else?

  • @jonathanbergamo7472
    @jonathanbergamo7472 Рік тому

    teach how to use next auth and axios interceptors to deal with refresh token using the new next 14

    • @SakuraDev
      @SakuraDev  Рік тому +1

      Hi, I have a video about it in next js 13. You can use that solution on nextjs 14 as well.

    • @SakuraDev
      @SakuraDev  Рік тому

      ua-cam.com/video/RPl0r-Yl6pU/v-deo.html

  • @amitodak
    @amitodak 8 місяців тому +1

    hi, can show how to send email with file upload?

    • @SakuraDev
      @SakuraDev  8 місяців тому +1

      Hi, yes you can . I will create a short video for that

  • @aryaadinulfadlan8998
    @aryaadinulfadlan8998 9 місяців тому

    is nodemailer completely free ?
    i want to use it in my real projects.

    • @SakuraDev
      @SakuraDev  9 місяців тому +1

      Yes it is free

    • @aryaadinulfadlan8998
      @aryaadinulfadlan8998 9 місяців тому

      @@SakuraDev thank you Mr. Sakura. really helpful 😃

    • @aryaadinulfadlan8998
      @aryaadinulfadlan8998 9 місяців тому

      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?

  • @ddd-wg4zz
    @ddd-wg4zz Рік тому

    nice🫰

  • @benjamingoller6267
    @benjamingoller6267 9 місяців тому +1

    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

  • @Benthetech-qn2lf
    @Benthetech-qn2lf 10 місяців тому

    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'

    • @Sasuke-kc6dw
      @Sasuke-kc6dw 9 місяців тому +1

      same do you have a solution?

    • @Benthetech-qn2lf
      @Benthetech-qn2lf 9 місяців тому

      @@Sasuke-kc6dw No how about you?

    • @Benthetech-qn2lf
      @Benthetech-qn2lf 9 місяців тому

      @@Sasuke-kc6dw But I'm now using resend

    • @sahilsworkmail
      @sahilsworkmail 8 місяців тому

      The function for sending email should be called on server only not on client,

    • @muddy2146
      @muddy2146 5 місяців тому

      The problem is that such a function cannot be used in client components. I also encountered a problem that the same error occurred when re-exporting this function, so just remove reexprot