Skip to content

wpcodevo/golang-gorm-postgres

 
 

Repository files navigation

Forgot/Reset Passwords in Golang with SMTP HTML Email

This article will teach you how to add a secure forgot/reset password feature to a Golang RESTful API application. We will generate the HTML Email templates with the standard Golang template package and send them via SMTP with the Gomail package.

Forgot/Reset Passwords in Golang with SMTP HTML Email

Topics Covered

  • Forgot Password and Password Reset Flow
  • Create the Database Models with GORM
  • Create an SMTP Account
  • Setup the HTML Templates
    • Add the Email Template CSS
    • Add the Password Reset HTML Template
  • Encoding/Decoding the Password Reset Code
  • Create a Utility Function to Send the Emails
  • Add the Forgot Password Route Handler
  • Add the Reset Password Route Handler
  • Add the API Routes to the Gin Middleware Stack

Read the entire article here: https://codevoweb.com/forgot-reset-passwords-in-golang-with-html-email

Articles in this series:

1. How to Setup Golang GORM RESTful API Project with Postgres

How to Setup Golang GORM RESTful API Project with Postgres

2. API with Golang + GORM + PostgreSQL: Access & Refresh Tokens

API with Golang + GORM + PostgreSQL: Access & Refresh Tokens

3. Golang and GORM - User Registration and Email Verification

Golang and GORM - User Registration and Email Verification

4. Forgot/Reset Passwords in Golang with SMTP HTML Email

Forgot/Reset Passwords in Golang with SMTP HTML Email

5. Build a RESTful CRUD API with Golang

Build a RESTful CRUD API with Golang

About

In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages