gmail

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "gmail"
)

Variables

View Source
var (
	Module = Gmail{}
)

Functions

func GetTemplatesHandler

func GetTemplatesHandler(app libservice.App) libhttp.Service

func PostSendEmailsHandler

func PostSendEmailsHandler(app libservice.App) libhttp.Service

func PostSendTemplatedEmailsHandler

func PostSendTemplatedEmailsHandler(app libservice.App) libhttp.Service

Types

type GetTemplatesResponse

type GetTemplatesResponse struct {
	Templates []libemail.Template `json:"templates"`
}

type Gmail

type Gmail struct {
	Debug     bool
	Sender    *senders.GmailSender
	Templates []libemail.Template
}

func NewModule

func NewModule(opts ...Option) (*Gmail, error)

func (*Gmail) LongPath

func (g *Gmail) LongPath(route libservice.Route) string

func (*Gmail) Namespace

func (g *Gmail) Namespace() string

func (*Gmail) Routes

func (g *Gmail) Routes() map[string]libservice.Route

func (Gmail) Send

func (g Gmail) Send(message *PostSendGmailRequest) (interface{}, error)

func (*Gmail) Version

func (g *Gmail) Version() string

type Option

type Option func(e *Gmail) error

func WithDebug

func WithDebug(debug bool) Option

func WithGmailSender

func WithGmailSender(sender *senders.GmailSender) Option

func WithTemplates

func WithTemplates(templates ...string) Option

func WithTokenConfig

func WithTokenConfig(config *oauth2.Config, token *oauth2.Token) Option

type PostSendGmailRequest

type PostSendGmailRequest libemail.Email

func (PostSendGmailRequest) Validate

func (r PostSendGmailRequest) Validate() error

type PostSendTemplatedGmailRequest

type PostSendTemplatedGmailRequest struct {
	libemail.Email `json:",inline"`
	Template       string            `json:"template"`
	Parameters     map[string]string `json:"parameters"`
}

func (PostSendTemplatedGmailRequest) Validate

func (r PostSendTemplatedGmailRequest) Validate() error

Jump to

Keyboard shortcuts

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