notification

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 6 Imported by: 2

README

gFly Notification

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

Quick usage main.go

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

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 Register

func Register(notifyType reflect.Type, handler fnHandler)

func Send

func Send(notification any) error

Send Deliver many notification types SMS|Mail|Slack|Database.

func Type

func Type(i any) reflect.Type

Types

type INotifiable

type INotifiable interface {
	Notify()
}

Directories

Path Synopsis
mail module

Jump to

Keyboard shortcuts

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