email

package
v0.0.0-...-7a2aee4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTemplate

func ParseTemplate(templateString string, data interface{}) (string, error)

ParseTemplate parses a template string and applies the provided data to it, returning the resulting string. If there is an error during the parsing or execution of the template, it returns an empty string and the error.

Types

type Provider

type Provider string

Provider defines the available email providers.

type Service

type Service interface {
	SendEmail(c context.Context, email entities.Email) error
}

Service defines an interface for sending emails. It provides a method to send an email with a given context and email details.

func NewEmailService

func NewEmailService(cfg *config.Config, awsClient *awsclient.AWSClient) Service

NewEmailService creates a new email service based on the given provider.

func NewSESEmailService

func NewSESEmailService(awsClient *awsclient.AWSClient) Service

NewSESEmailService creates a new instance of emailServiceImpl. It initializes the service with the given AWS client. This function returns an Service interface that wraps the emailServiceImpl.

func NewSMTPEmailService

func NewSMTPEmailService(cfg *config.Config) Service

NewSMTPEmailService initializes and returns a new instance of smtpServiceImpl. It sets up the SMTP authentication using the provided configuration and constructs the server address.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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