Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SESClient is used to send emails via SES. SESClient *ses.Client // S3Client is used to fetch attachments from S3. S3Client *s3.Client // HTTPClient is used to fetch attachments from the web. HTTPClient httpClient )
Functions ¶
func Initialize ¶
Initialize will initialize the email package. Both the profile and region parameters are optional if authentication can be achieved via another method. For example, environment variables or IAM roles.
Types ¶
type Attachment ¶
type Attachment struct {
Path string `json:"path"`
Type AttachmentType `json:"type"`
}
Attachment stores a path and type which are used to load it locally.
type AttachmentType ¶
type AttachmentType string
AttachmentType is a string type alias for the different supported attachment types.
const ( // AttachmentTypeLocal is used for local attachments. As this is // deployed as a Lambda function it's primary use is testing. AttachmentTypeLocal AttachmentType = "local" // AttachmentTypeS3 is used for attachments stored in S3. AttachmentTypeS3 AttachmentType = "s3" // AttachmentTypeHTTP is used for attachments publicly accessible via HTTP. AttachmentTypeHTTP AttachmentType = "http" )
type ContentType ¶
type ContentType string
ContentType is a string type alias for the different supported content types.
const ( // ContentTypeTextPlain is used for text/plain emails. ContentTypeTextPlain ContentType = "text/plain" // ContentTypeTextHTML is used for text/html emails. ContentTypeTextHTML ContentType = "text/html" )
type Data ¶
type Data struct {
To []string `json:"to"`
CC *[]string `json:"cc"`
BCC *[]string `json:"bcc"`
ReplyTo *[]string `json:"replyTo"`
From string `json:"from"`
Subject string `json:"subject"`
Body string `json:"body"`
ContentType ContentType `json:"contentType"`
Attachments []Attachment `json:"attachments"`
}
Data is the data required to build and send an email.
Click to show internal directories.
Click to hide internal directories.