Documentation
¶
Index ¶
- type Attachment
- type BasicMessage
- func (basic *BasicMessage) AddBccEmailAddress(email string)
- func (basic *BasicMessage) AddBccFriendlyEmailAddress(email string, friendly string)
- func (basic *BasicMessage) AddCcEmailAddress(email string)
- func (basic *BasicMessage) AddCcFriendlyEmailAddress(email string, friendly string)
- func (basic *BasicMessage) AddCustomHeader(name string, value string)
- func (basic *BasicMessage) AddMetadata(key string, value string)
- func (basic *BasicMessage) AddTag(value string)
- func (basic *BasicMessage) AddToEmailAddress(email string)
- func (basic *BasicMessage) AddToFriendlyEmailAddress(email string, friendly string)
- type BulkMessage
- func (bulk *BulkMessage) AddCustomHeader(name string, value string)
- func (bulk *BulkMessage) AddGlobalMergeData(key string, value string)
- func (bulk *BulkMessage) AddMetadata(key string, value string)
- func (bulk *BulkMessage) AddTag(value string)
- func (bulk *BulkMessage) AddToBulkRecipient(email string) BulkRecipient
- func (bulk *BulkMessage) AddToFriendlyBulkRecipient(email string, friendly string) BulkRecipient
- type BulkRecipient
- type CustomHeader
- type EmailAddress
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Content []byte MimeType string Name string ContentID string CustomHeaders []CustomHeader }
Attachment info
func NewAttachment ¶
func NewAttachment(filePath string) (Attachment, error)
NewAttachment Factory Constructor that creates attachment using content from specified file and path.
func NewAttachmentFromBytes ¶
func NewAttachmentFromBytes(name string, mimeType string, content []byte) (Attachment, error)
NewAttachmentFromByteArray Factory Constructor that creates attachment using content from a byte array
func NewAttachmentFromFile ¶
func NewAttachmentFromFile(name string, mimeType string, filePath string) (Attachment, error)
NewAttachmentFromFile Factory Constructor that creates attachment using content from specified file and path.
func (*Attachment) AddCustomHeader ¶
func (attachment *Attachment) AddCustomHeader(name string, value string)
AddCustomHeader adds a custom header to the attachment
type BasicMessage ¶
type BasicMessage struct { //The message subject. Subject string // Plain text portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate PlainTextBody string // HTML portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate HtmlBody string // AMP portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate AmpBody string // Api Template for the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate ApiTemplate string //Custom MailingId for the message. //See https://www.socketlabs.com/blog/best-practices-for-using-custom-mailingids-and-messageids/ for more information. //(Optional) MailingId string //Custom MessageId for the message. //(Optional) MessageId string //From Address for the message. From EmailAddress //ReplyTo Address for the message. //(Optional) ReplyTo EmailAddress //The optional character set for the message. //(Optional) CharSet string //Optional collection of message attachments. //(Optional) Attachments []Attachment //Optional collection of custom headers for the message. //(Optional) CustomHeaders []CustomHeader //Optional collection of meta data for the message. //(Optional) Metadata []Metadata //Optional collection of tags for the message. //(Optional) Tags []string //Collection of To Recipients for the message. To []EmailAddress //Collection of CC Recipients for the message. Cc []EmailAddress //Collection of BCC Recipients for the message. Bcc []EmailAddress }
BasicMessage is a message similar to one created in a personal email client such as Outlook. This message can have many recipients of different types, such as To, CC, and BCC. This message does not support merge fields.
func (*BasicMessage) AddBccEmailAddress ¶
func (basic *BasicMessage) AddBccEmailAddress(email string)
AddBccEmailAddress adds an email address to the Bcc Recipients collection
func (*BasicMessage) AddBccFriendlyEmailAddress ¶
func (basic *BasicMessage) AddBccFriendlyEmailAddress(email string, friendly string)
AddBccFriendlyEmailAddress adds an email address paired with a friendlyname to the Bcc Recipients collection
func (*BasicMessage) AddCcEmailAddress ¶
func (basic *BasicMessage) AddCcEmailAddress(email string)
AddCcEmailAddress adds an email address to the Cc Recipients collection
func (*BasicMessage) AddCcFriendlyEmailAddress ¶
func (basic *BasicMessage) AddCcFriendlyEmailAddress(email string, friendly string)
AddCcFriendlyEmailAddress adds an email address paired with a friendlyname to the Cc Recipients collection
func (*BasicMessage) AddCustomHeader ¶
func (basic *BasicMessage) AddCustomHeader(name string, value string)
AddCustomHeader adds a custom header to the message
func (*BasicMessage) AddMetadata ¶ added in v1.4.0
func (basic *BasicMessage) AddMetadata(key string, value string)
AddMetadata adds meta data to the message
func (*BasicMessage) AddTag ¶ added in v1.4.0
func (basic *BasicMessage) AddTag(value string)
AddTag adds a tag to the message
func (*BasicMessage) AddToEmailAddress ¶
func (basic *BasicMessage) AddToEmailAddress(email string)
AddToEmailAddress adds an email address to the To Recipients collection
func (*BasicMessage) AddToFriendlyEmailAddress ¶
func (basic *BasicMessage) AddToFriendlyEmailAddress(email string, friendly string)
AddToFriendlyEmailAddress adds an email address paired with a friendlyname to the To Recipients collection
type BulkMessage ¶
type BulkMessage struct { //The message subject. Subject string // Plain text portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate PlainTextBody string // HTML portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate HtmlBody string // AMP portion of the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate AmpBody string // Api Template for the message body. // (Optional) Either TextBody or HtmlBody must be used with the AmpBody or use a ApiTemplate ApiTemplate string //Custom MailingId for the message. //See https://www.socketlabs.com/blog/best-practices-for-using-custom-mailingids-and-messageids/ for more information. //(Optional) MailingId string //Custom MessageId for the message. //(Optional) MessageId string //From Address for the message. From EmailAddress //ReplyTo Address for the message. //(Optional) ReplyTo EmailAddress //The optional character set for the message. //(Optional) CharSet string // Optional collection of message attachments. // (Optional) Attachments []Attachment // Optional collection of custom headers for the message. // (Optional) CustomHeaders []CustomHeader //Optional collection of meta data for the message. //(Optional) Metadata []Metadata //Optional collection of tags for the message. //(Optional) Tags []string //Collection of To Recipients for the message. To []BulkRecipient // Optional Merge data that is global across the whole message. // (Optional) Global map[string]string }
BulkMessage usually contains a single recipient per message and is generally used to send the same content to many recipients, optionally customizing the message via the use of MergeData.
func (*BulkMessage) AddCustomHeader ¶
func (bulk *BulkMessage) AddCustomHeader(name string, value string)
AddCustomHeader adds a custom header to the message
func (*BulkMessage) AddGlobalMergeData ¶
func (bulk *BulkMessage) AddGlobalMergeData(key string, value string)
AddGlobalMergeData adds global merge data
func (*BulkMessage) AddMetadata ¶ added in v1.4.0
func (bulk *BulkMessage) AddMetadata(key string, value string)
AddCustomHeader adds meta data to the message
func (*BulkMessage) AddTag ¶ added in v1.4.0
func (bulk *BulkMessage) AddTag(value string)
AddCustomHeader adds a tag to the message
func (*BulkMessage) AddToBulkRecipient ¶
func (bulk *BulkMessage) AddToBulkRecipient(email string) BulkRecipient
AddToBulkRecipient add an email address to the To recipients collection
func (*BulkMessage) AddToFriendlyBulkRecipient ¶
func (bulk *BulkMessage) AddToFriendlyBulkRecipient(email string, friendly string) BulkRecipient
AddToFriendlyBulkRecipient adds an email address paired with a friendly name to the To Recipients collection
type BulkRecipient ¶
BulkRecipient struct
func NewBulkRecipient ¶
func NewBulkRecipient(email string) BulkRecipient
NewBulkRecipient Factory Constructor
func NewFriendlyBulkRecipient ¶
func NewFriendlyBulkRecipient(email string, friendlyName string) BulkRecipient
NewFriendlyBulkRecipient Factory Constructor
func (*BulkRecipient) AddMergeData ¶
func (recipient *BulkRecipient) AddMergeData(key string, value string) *BulkRecipient
AddGlobalMergeData adds global merge data
func (BulkRecipient) IsValid ¶
func (e BulkRecipient) IsValid() bool
IsValid Determines if the Email Address is valid
type CustomHeader ¶
CustomHeader info
func NewCustomHeader ¶
func NewCustomHeader(name string, value string) CustomHeader
NewCustomHeader Factory Constructor
func (CustomHeader) IsValid ¶
func (c CustomHeader) IsValid() bool
IsValid Determines if the CustomHeader is valid
type EmailAddress ¶
EmailAddress info
func NewEmailAddress ¶
func NewEmailAddress(email string) EmailAddress
NewEmailAddress Factory Constructor
func NewFriendlyEmailAddress ¶
func NewFriendlyEmailAddress(email string, friendlyName string) EmailAddress
NewFriendlyEmailAddress Factory Constructor
func (EmailAddress) IsValid ¶
func (e EmailAddress) IsValid() bool
IsValid Determines if the Email Address is valid
type Metadata ¶ added in v1.4.0
CustomHeader info
func NewMetadata ¶ added in v1.4.0
NewMetadata Factory Constructor