email

package
v7.6.84 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: GPL-3.0 Imports: 20 Imported by: 3

Documentation

Overview

Package email provides functionality for sending email messages via Mandrill

Index

Constants

This section is empty.

Variables

View Source
var Key = "5279526e53385644704f6f703147706f56796e435a41"

Only allowed to call /send_template. Just make it more annoying to determine the key by examining the binary by encoding it in hex. Just thwart casual attackers for a relatively low value key.

Functions

func Send

func Send(ctx context.Context, msg *Message) error

func SetDefaultRecipient

func SetDefaultRecipient(address string)

SetDefaultRecipient configures the email address that will receive emails

func SetHTTPClient

func SetHTTPClient(client *http.Client)

SetHTTPClient configures an alternate http.Client to use when sending emails

Types

type Message

type Message struct {
	// The mandrill template slug
	Template string
	// The email address of the sender
	From string
	// The email address to which the message is sent
	To string
	// An optional email address to carbon copy
	CC string `json:"cc,omitempty"`
	// Email subject
	Subject string
	// Any global vars defined in the template
	Vars map[string]interface{}
	// Serialized settings data
	SettingsData []byte
	// Specify the maximum size of the not-compressed log files attached to the
	// email, can be in "KB/MB/GB" fromat. Not attaching logs if it's an empty
	// string.  Make sure the compressed files doesn't cause the message to exceed
	// the limit of Mandrill message size, which is 25MB.
	MaxLogSize string `json:"maxLogSize,omitempty"`
	// Logs allows the caller to specify an already zipped set of logs
	Logs []byte
	// DiagnosticsYAML is a YAML-encoded diagnostics report.
	DiagnosticsYAML []byte
	// ProxyCapture is a gzipped pcapng file related to diagnostics.
	ProxyCapture []byte
	// Proxies allows the caller to specify a proxies.yaml file
	Proxies []byte
}

Message is a templatized email message

Jump to

Keyboard shortcuts

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