mail

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 3 Imported by: 1

README

gFly Notification - Mail

Copyright © 2023, gFly
https://www.gFly.dev
All rights reserved.
Usage

Install

go get -u github.com/gflydev/notification@v1.0.0
go get -u github.com/gflydev/notification/mail@v1.0.1

Quick usage main.go

import (
    notificationMail "github.com/gflydev/notification/mail"
    "github.com/gflydev/notification"
)

notificationMail.AutoRegister()

Notification file

type ResetPassword struct {
}

func (n ResetPassword) ToEmail() notifyMail.Data {
    return notifyMail.Data{
        To:      "vinh@jivecode.com",
        Subject: "Mail title",
        Body:    "Mail body",
    }
}

resetPassword := ResetPassword{}
if err := notification.Send(resetPassword); err != nil {
    log.Error(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoRegister added in v1.0.1

func AutoRegister()

Types

type Data

type Data struct {
	To      string
	Cc      string
	Subject string
	Body    string
}

type IMailNotification

type IMailNotification interface {
	ToEmail() Data
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL