Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
Content string `json:"content,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Filename string `json:"filename,omitempty"`
Disposition string `json:"disposition,omitempty"`
ContentID string `json:"contentId,omitempty"`
}
Attachment holds attachement information
type List ¶
type List struct {
// External ID of email list
Id string `json:"id"`
// Provider integration ID
ProviderId string `json:"providerId,omitempty"`
// Respect double-optin or not
DoubleOptin bool `json:"doubleOptin"`
// Whether to update existing contacts
UpdateExisting bool `json:"updateExisting"`
// Whether to replace interests
ReplaceInterests bool `json:"replaceInterests"`
// Whether this list is enabled or not
Enabled bool `json:"enabled"`
}
Mailchimp configuration
type Marketer ¶
type Marketer interface {
Subscribe(l *List, s *Subscriber) error
}
type Message ¶
type Message struct {
Subject string `json:"subject,omitempty"`
From Email `json:"from"`
ReplyTo Email `json:"replyTo,omitempty"`
To []Email `json:"to"`
CC []Email `json:"cc,omitempty"`
BCC []Email `json:"bcc,omitempty"`
HTML string `json:"html,omitempty"`
Text string `json:"text,omitempty"`
TemplateData map[string]map[string]interface{} `json:"templateData,omitempty"`
TemplateID string `json:"templateId,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
Substitutions Substitutions `json:"substitutions,omitempty"`
Personalizations Personalizations `json:"personalizations,omitempty"`
Headers []Header `json:"headers,omitempty"`
SendAt time.Time `json:"sendAt,omitempty"`
Tags []string `json:"tags,omitempty"`
Tracking Tracking `json:"tracking,omitempty"`
}
Represents a single email message
func NewMessage ¶
func NewMessage() *Message
func (*Message) AddAttachments ¶
func (m *Message) AddAttachments(ats ...Attachment)
func (*Message) AddPersonalizations ¶
func (m *Message) AddPersonalizations(personalizations Personalizations)
func (*Message) AddSubsitutions ¶
func (m *Message) AddSubsitutions(subs Substitutions)
type Personalization ¶
type Personalization struct {
// Override default message
Substitutions Substitutions `json:"substitution"`
Subject string `json:"subject,omitempty"`
Headers []Header `json:"headers,omitempty"`
SendAt time.Time `json:"sendAt,omitempty"`
}
Tags to replace in an email for a specific recipient
func NewPersonalization ¶
func NewPersonalization() *Personalization
type Personalizations ¶
type Personalizations map[string]*Personalization
Map of address -> personalizations
type Setting ¶
type Setting struct {
Enabled bool `json:"enabled"`
From Email `json:"from"`
ReplyTo Email `json:"replyTo"`
Subject string `json:"subject"`
CC []Email `json:"cc,omitempty"`
BCC []Email `json:"bcc,omitempty"`
HTML string `json:"html,omitempty" datastore:",noindex"`
Text string `json:"text,omitempty" datastore:",noindex"`
TemplateId string `json:"templateId,omitempty"`
ProviderId string `json:"providerId"`
}
type Settings ¶
type Settings struct {
// Global enable/disable of email
Enabled bool `json:"enabled"`
// Defaults for all email settings
Defaults struct {
From Email `json:"from"`
ReplyTo Email `json:"replyTo"`
CC []Email `json:"cc,omitempty"`
BCC []Email `json:"bcc,omitempty"`
ProviderId string `json:"providerId"`
} `json:"defaults"`
// Per-email configuration
Affiliate struct {
Welcome Setting `json:"welcome"`
} `json:"affiliate"`
Order struct {
Confirmation Setting `json:"confirmation"`
Refund Setting `json:"refund"`
RefundPartial Setting `json:"refundPartial"`
Shipped Setting `json:"shipped"`
Updated Setting `json:"updated"`
} `json:"order"`
User struct {
Welcome Setting `json:"welcome"`
ConfirmEmail Setting `json:"confirmEmail"`
Activated Setting `json:"activated"`
ResetPassword Setting `json:"resetPassword"`
PasswordUpdated Setting `json:"updatePassword"`
} `json:"user"`
Subscriber struct {
Welcome Setting `json:"welcome"`
} `json:"subscriber"`
}
System-wide email settings
type Subscriber ¶
type Subscriber struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email Email `json:"email"`
Metadata Map `json:"metadata"`
Tags []string `json:"tags"`
}
func (Subscriber) Md5 ¶
func (s Subscriber) Md5() string
type Substitutions ¶
Map of substiutitons to apply to email on provider side
type Type ¶
type Type string
Types of system-defined emails
const ( AffiliateWelcome Type = "affiliate.welcome" OrderConfirmation Type = "order.confirmation" OrderRefund Type = "order.refund" OrderRefundPartial Type = "order.refund-partial" OrderShipped Type = "order.shipped" OrderUpdated Type = "order.updated" ReferralSignup Type = "referral.signup" SubscriberWelcome Type = "subscriber.welcome" UserActivated Type = "user.activated" UserConfirmEmail Type = "user.confirmemail" UserPasswordUpdated Type = "user.passwordUpdated" UserResetPassword Type = "user.resetPassword" UserUpdated Type = "user.updated" UserWelcome Type = "user.welcome" )
Click to show internal directories.
Click to hide internal directories.