mail

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImplMail

type ImplMail struct {
	// contains filtered or unexported fields
}

ImplMail is the mail service implementation

func NewMail

func NewMail(infrastructure infrastructure.Interactor) *ImplMail

NewMail initializes a mail service instance

func (*ImplMail) GenerateEmailTemplate

func (m *ImplMail) GenerateEmailTemplate(
	name string,
	templateName string,
) string

GenerateEmailTemplate generates templates for email

func (*ImplMail) SendEmail

func (m *ImplMail) SendEmail(
	ctx context.Context,
	subject,
	text string,
	body *string,
	to ...string,
) (string, string, error)

SendEmail sends email using mailgun service

func (*ImplMail) SendInBlue

func (m *ImplMail) SendInBlue(
	ctx context.Context,
	subject,
	text string,
	to ...string,
) (string, string, error)

SendInBlue sends email using sendinblue service

func (*ImplMail) SendMailgun

func (m *ImplMail) SendMailgun(
	ctx context.Context,
	subject,
	text string,
	body *string,
	to ...string,
) (string, string, error)

SendMailgun sends email using mailgun service

func (*ImplMail) SimpleEmail

func (m *ImplMail) SimpleEmail(
	ctx context.Context,
	subject,
	text string,
	body *string,
	to ...string,
) (string, error)

SimpleEmail sends email using mailgun service

func (*ImplMail) UpdateMailgunDeliveryStatus

func (m *ImplMail) UpdateMailgunDeliveryStatus(
	ctx context.Context,
	payload *dto.MailgunEvent,
) (*dto.OutgoingEmailsLog, error)

UpdateMailgunDeliveryStatus updates mailgun delivery status

type UsecaseMail

type UsecaseMail interface {
	SendInBlue(
		ctx context.Context,
		subject,
		text string,
		to ...string,
	) (string, string, error)

	SendMailgun(
		ctx context.Context,
		subject,
		text string,
		body *string,
		to ...string,
	) (string, string, error)

	SendEmail(
		ctx context.Context,
		subject,
		text string,
		body *string,
		to ...string,
	) (string, string, error)

	SimpleEmail(
		ctx context.Context,
		subject,
		text string,
		body *string,
		to ...string,
	) (string, error)

	UpdateMailgunDeliveryStatus(
		ctx context.Context,
		payload *dto.MailgunEvent,
	) (*dto.OutgoingEmailsLog, error)

	GenerateEmailTemplate(
		name string,
		templateName string,
	) string
}

UsecaseMail defines mail service usecases interface

Jump to

Keyboard shortcuts

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