emailing

package module
v0.0.0-...-9836b30 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

README

COOPGO Emailing

COOPGO Emailing is the emailing library of the COOPGO Technical Platform.

It provides :

  • A library for transactional emailing management
  • In the future, a gRPC webservice implementing the functionalities of this library

Functionalities :

  • Generate emails
  • Emails and
  • Send emails through SMTP

Expected functionalities (roadmap) :

  • Receiving and handling emails within a Go application or with webhooks

COOPGO Emailing is part of the COOPGO Technical Platform.

Why ?

This library is used in new COOPGO projects to replace transactional email providers APIs. Our transactional emails are relatively simple and we wanted to avoid complex and proprietary email builders dependencies.

Licence

This project is under the AGPLv3 licence.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnescapeHTML

func UnescapeHTML(s string) template.HTML

Types

type Mailer

type Mailer struct {
	TemplatesDir    string
	TemplatesConfig *viper.Viper
	SMTPConfig
}

func NewMailer

func NewMailer(templates_dir string, tplcfg *viper.Viper, smtpconfig *viper.Viper) (*Mailer, error)

func (*Mailer) Send

func (m *Mailer) Send(emailcfg string, to string, data any, opts ...Option) error

type Option

type Option func(*mail.Msg, []mail.Option) ([]mail.Option, error)

func WithReplyTo

func WithReplyTo(email string) Option

func WithTLSOpportunistic

func WithTLSOpportunistic() Option

type SMTPConfig

type SMTPConfig struct {
	Host     string
	Port     int
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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