Documentation ¶
Index ¶
- func GetRequestBody(m *SGMailV3) []byte
- type Asm
- type Attachment
- func (a *Attachment) SetContent(content string) *Attachment
- func (a *Attachment) SetContentID(contentID string) *Attachment
- func (a *Attachment) SetDisposition(disposition string) *Attachment
- func (a *Attachment) SetFilename(filename string) *Attachment
- func (a *Attachment) SetType(contentType string) *Attachment
- type BccSetting
- type ClickTrackingSetting
- type Content
- type Email
- type FooterSetting
- type GaSetting
- func (g *GaSetting) SetCampaignContent(campaignContent string) *GaSetting
- func (g *GaSetting) SetCampaignMedium(campaignMedium string) *GaSetting
- func (g *GaSetting) SetCampaignName(campaignName string) *GaSetting
- func (g *GaSetting) SetCampaignSource(campaignSource string) *GaSetting
- func (g *GaSetting) SetCampaignTerm(campaignTerm string) *GaSetting
- func (g *GaSetting) SetEnable(enable bool) *GaSetting
- type MailSettings
- func (m *MailSettings) SetBCC(bcc *BccSetting) *MailSettings
- func (m *MailSettings) SetBypassBounceManagement(bypassBounceManagement *Setting) *MailSettings
- func (m *MailSettings) SetBypassListManagement(bypassListManagement *Setting) *MailSettings
- func (m *MailSettings) SetBypassSpamManagement(bypassSpamManagement *Setting) *MailSettings
- func (m *MailSettings) SetBypassUnsubscribeManagement(bypassUnsubscribeManagement *Setting) *MailSettings
- func (m *MailSettings) SetFooter(footerSetting *FooterSetting) *MailSettings
- func (m *MailSettings) SetSandboxMode(sandboxMode *Setting) *MailSettings
- func (m *MailSettings) SetSpamCheckSettings(spamCheckSetting *SpamCheckSetting) *MailSettings
- type OpenTrackingSetting
- type Personalization
- func (p *Personalization) AddBCCs(bcc ...*Email)
- func (p *Personalization) AddCCs(cc ...*Email)
- func (p *Personalization) AddFrom(from *Email)
- func (p *Personalization) AddTos(to ...*Email)
- func (p *Personalization) SetCustomArg(key string, value string)
- func (p *Personalization) SetDynamicTemplateData(key string, value interface{})
- func (p *Personalization) SetHeader(key string, value string)
- func (p *Personalization) SetSendAt(sendAt int)
- func (p *Personalization) SetSubstitution(key string, value string)
- type SGMailV3
- func NewSingleEmail(from *Email, subject string, to *Email, plainTextContent string, ...) *SGMailV3
- func NewSingleEmailPlainText(from *Email, subject string, to *Email, plainTextContent string) *SGMailV3
- func NewV3Mail() *SGMailV3
- func NewV3MailInit(from *Email, subject string, to *Email, content ...*Content) *SGMailV3
- func (s *SGMailV3) AddAttachment(a ...*Attachment) *SGMailV3
- func (s *SGMailV3) AddCategories(category ...string) *SGMailV3
- func (s *SGMailV3) AddContent(c ...*Content) *SGMailV3
- func (s *SGMailV3) AddPersonalizations(p ...*Personalization) *SGMailV3
- func (s *SGMailV3) AddSection(key string, value string) *SGMailV3
- func (s *SGMailV3) SetASM(asm *Asm) *SGMailV3
- func (s *SGMailV3) SetBatchID(batchID string) *SGMailV3
- func (s *SGMailV3) SetCustomArg(key string, value string) *SGMailV3
- func (s *SGMailV3) SetFrom(e *Email) *SGMailV3
- func (s *SGMailV3) SetHeader(key string, value string) *SGMailV3
- func (s *SGMailV3) SetIPPoolID(ipPoolID string) *SGMailV3
- func (s *SGMailV3) SetMailSettings(mailSettings *MailSettings) *SGMailV3
- func (s *SGMailV3) SetReplyTo(e *Email) *SGMailV3
- func (s *SGMailV3) SetSendAt(sendAt int) *SGMailV3
- func (s *SGMailV3) SetTemplateID(templateID string) *SGMailV3
- func (s *SGMailV3) SetTrackingSettings(trackingSettings *TrackingSettings) *SGMailV3
- type SandboxModeSetting
- type Setting
- type SpamCheckSetting
- type SubscriptionTrackingSetting
- func (s *SubscriptionTrackingSetting) SetEnable(enable bool) *SubscriptionTrackingSetting
- func (s *SubscriptionTrackingSetting) SetHTML(html string) *SubscriptionTrackingSetting
- func (s *SubscriptionTrackingSetting) SetSubstitutionTag(subTag string) *SubscriptionTrackingSetting
- func (s *SubscriptionTrackingSetting) SetText(text string) *SubscriptionTrackingSetting
- type TrackingSettings
- func (t *TrackingSettings) SetClickTracking(clickTracking *ClickTrackingSetting) *TrackingSettings
- func (t *TrackingSettings) SetGoogleAnalytics(googleAnalytics *GaSetting) *TrackingSettings
- func (t *TrackingSettings) SetOpenTracking(openTracking *OpenTrackingSetting) *TrackingSettings
- func (t *TrackingSettings) SetSubscriptionTracking(subscriptionTracking *SubscriptionTrackingSetting) *TrackingSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Asm ¶
type Asm struct { GroupID int `json:"group_id,omitempty"` GroupsToDisplay []int `json:"groups_to_display,omitempty"` }
Asm contains Grpip Id and int array of groups ID
func (*Asm) AddGroupsToDisplay ¶
AddGroupsToDisplay ...
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:"content_id,omitempty"` }
Attachment holds attachement information
func (*Attachment) SetContent ¶
func (a *Attachment) SetContent(content string) *Attachment
SetContent ...
func (*Attachment) SetContentID ¶
func (a *Attachment) SetContentID(contentID string) *Attachment
SetContentID ...
func (*Attachment) SetDisposition ¶
func (a *Attachment) SetDisposition(disposition string) *Attachment
SetDisposition ...
func (*Attachment) SetFilename ¶
func (a *Attachment) SetFilename(filename string) *Attachment
SetFilename ...
func (*Attachment) SetType ¶
func (a *Attachment) SetType(contentType string) *Attachment
SetType ...
type BccSetting ¶
type BccSetting struct { Enable *bool `json:"enable,omitempty"` Email string `json:"email,omitempty"` }
BccSetting holds email bcc setings to enable of disable default is false
func (*BccSetting) SetEnable ¶
func (b *BccSetting) SetEnable(enable bool) *BccSetting
SetEnable ...
type ClickTrackingSetting ¶
type ClickTrackingSetting struct { Enable *bool `json:"enable,omitempty"` EnableText *bool `json:"enable_text,omitempty"` }
ClickTrackingSetting ...
func NewClickTrackingSetting ¶
func NewClickTrackingSetting() *ClickTrackingSetting
NewClickTrackingSetting ...
func (*ClickTrackingSetting) SetEnable ¶
func (c *ClickTrackingSetting) SetEnable(enable bool) *ClickTrackingSetting
SetEnable ...
func (*ClickTrackingSetting) SetEnableText ¶
func (c *ClickTrackingSetting) SetEnableText(enableText bool) *ClickTrackingSetting
SetEnableText ...
type Email ¶
Email holds email name and address info
func ParseEmail ¶
ParseEmail parses a string that contains an rfc822 formatted email address and returns an instance of *Email.
type FooterSetting ¶
type FooterSetting struct {}
FooterSetting holds enaable/disable settings and the format of footer i.e HTML/Text
func (*FooterSetting) SetEnable ¶
func (f *FooterSetting) SetEnable(enable bool) *FooterSetting
SetEnable ...
func (*FooterSetting) SetHTML ¶
func (f *FooterSetting) SetHTML(html string) *FooterSetting
SetHTML ...
func (*FooterSetting) SetText ¶
func (f *FooterSetting) SetText(text string) *FooterSetting
SetText ...
type GaSetting ¶
type GaSetting struct { Enable *bool `json:"enable,omitempty"` CampaignSource string `json:"utm_source,omitempty"` CampaignTerm string `json:"utm_term,omitempty"` CampaignContent string `json:"utm_content,omitempty"` CampaignName string `json:"utm_campaign,omitempty"` CampaignMedium string `json:"utm_medium,omitempty"` }
GaSetting ...
func (*GaSetting) SetCampaignContent ¶
SetCampaignContent ...
func (*GaSetting) SetCampaignMedium ¶
SetCampaignMedium ...
func (*GaSetting) SetCampaignName ¶
SetCampaignName ...
func (*GaSetting) SetCampaignSource ¶
SetCampaignSource ...
func (*GaSetting) SetCampaignTerm ¶
SetCampaignTerm ...
type MailSettings ¶
type MailSettings struct { BCC *BccSetting `json:"bcc,omitempty"` BypassListManagement *Setting `json:"bypass_list_management,omitempty"` BypassSpamManagement *Setting `json:"bypass_spam_management,omitempty"` BypassBounceManagement *Setting `json:"bypass_bounce_management,omitempty"` BypassUnsubscribeManagement *Setting `json:"bypass_unsubscribe_management,omitempty"` SandboxMode *Setting `json:"sandbox_mode,omitempty"` SpamCheckSetting *SpamCheckSetting `json:"spam_check,omitempty"` }
MailSettings defines mail and spamCheck settings
func (*MailSettings) SetBCC ¶
func (m *MailSettings) SetBCC(bcc *BccSetting) *MailSettings
SetBCC ...
func (*MailSettings) SetBypassBounceManagement ¶
func (m *MailSettings) SetBypassBounceManagement(bypassBounceManagement *Setting) *MailSettings
SetBypassBounceManagement ...
func (*MailSettings) SetBypassListManagement ¶
func (m *MailSettings) SetBypassListManagement(bypassListManagement *Setting) *MailSettings
SetBypassListManagement ...
func (*MailSettings) SetBypassSpamManagement ¶
func (m *MailSettings) SetBypassSpamManagement(bypassSpamManagement *Setting) *MailSettings
SetBypassSpamManagement ...
func (*MailSettings) SetBypassUnsubscribeManagement ¶
func (m *MailSettings) SetBypassUnsubscribeManagement(bypassUnsubscribeManagement *Setting) *MailSettings
SetBypassUnsubscribeManagement ...
func (*MailSettings) SetFooter ¶
func (m *MailSettings) SetFooter(footerSetting *FooterSetting) *MailSettings
SetFooter ...
func (*MailSettings) SetSandboxMode ¶
func (m *MailSettings) SetSandboxMode(sandboxMode *Setting) *MailSettings
SetSandboxMode ...
func (*MailSettings) SetSpamCheckSettings ¶
func (m *MailSettings) SetSpamCheckSettings(spamCheckSetting *SpamCheckSetting) *MailSettings
SetSpamCheckSettings ...
type OpenTrackingSetting ¶
type OpenTrackingSetting struct { Enable *bool `json:"enable,omitempty"` SubstitutionTag string `json:"substitution_tag,omitempty"` }
OpenTrackingSetting ...
func NewOpenTrackingSetting ¶
func NewOpenTrackingSetting() *OpenTrackingSetting
NewOpenTrackingSetting ...
func (*OpenTrackingSetting) SetEnable ¶
func (o *OpenTrackingSetting) SetEnable(enable bool) *OpenTrackingSetting
SetEnable ...
func (*OpenTrackingSetting) SetSubstitutionTag ¶
func (o *OpenTrackingSetting) SetSubstitutionTag(subTag string) *OpenTrackingSetting
SetSubstitutionTag ...
type Personalization ¶
type Personalization struct { To []*Email `json:"to,omitempty"` From *Email `json:"from,omitempty"` CC []*Email `json:"cc,omitempty"` BCC []*Email `json:"bcc,omitempty"` Subject string `json:"subject,omitempty"` Headers map[string]string `json:"headers,omitempty"` Substitutions map[string]string `json:"substitutions,omitempty"` CustomArgs map[string]string `json:"custom_args,omitempty"` DynamicTemplateData map[string]interface{} `json:"dynamic_template_data,omitempty"` Categories []string `json:"categories,omitempty"` SendAt int `json:"send_at,omitempty"` }
Personalization holds mail body struct
func (*Personalization) SetCustomArg ¶
func (p *Personalization) SetCustomArg(key string, value string)
SetCustomArg ...
func (*Personalization) SetDynamicTemplateData ¶
func (p *Personalization) SetDynamicTemplateData(key string, value interface{})
SetDynamicTemplateData ...
func (*Personalization) SetHeader ¶
func (p *Personalization) SetHeader(key string, value string)
SetHeader ...
func (*Personalization) SetSubstitution ¶
func (p *Personalization) SetSubstitution(key string, value string)
SetSubstitution ...
type SGMailV3 ¶
type SGMailV3 struct { From *Email `json:"from,omitempty"` Subject string `json:"subject,omitempty"` Personalizations []*Personalization `json:"personalizations,omitempty"` Content []*Content `json:"content,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` TemplateID string `json:"template_id,omitempty"` Sections map[string]string `json:"sections,omitempty"` Headers map[string]string `json:"headers,omitempty"` Categories []string `json:"categories,omitempty"` CustomArgs map[string]string `json:"custom_args,omitempty"` SendAt int `json:"send_at,omitempty"` BatchID string `json:"batch_id,omitempty"` Asm *Asm `json:"asm,omitempty"` IPPoolID string `json:"ip_pool_name,omitempty"` MailSettings *MailSettings `json:"mail_settings,omitempty"` TrackingSettings *TrackingSettings `json:"tracking_settings,omitempty"` ReplyTo *Email `json:"reply_to,omitempty"` }
SGMailV3 contains mail struct
func NewSingleEmail ¶
func NewSingleEmail(from *Email, subject string, to *Email, plainTextContent string, htmlContent string) *SGMailV3
NewSingleEmail ...
func NewSingleEmailPlainText ¶
func NewSingleEmailPlainText(from *Email, subject string, to *Email, plainTextContent string) *SGMailV3
NewSingleEmailPlainText is used to build *SGMailV3 object having only 'plain-text' as email content.
func NewV3MailInit ¶
NewV3MailInit ...
func (*SGMailV3) AddAttachment ¶
func (s *SGMailV3) AddAttachment(a ...*Attachment) *SGMailV3
AddAttachment ...
func (*SGMailV3) AddCategories ¶
AddCategories ...
func (*SGMailV3) AddPersonalizations ¶
func (s *SGMailV3) AddPersonalizations(p ...*Personalization) *SGMailV3
AddPersonalizations ...
func (*SGMailV3) AddSection ¶
AddSection ...
func (*SGMailV3) SetBatchID ¶
SetBatchID ...
func (*SGMailV3) SetCustomArg ¶
SetCustomArg ...
func (*SGMailV3) SetIPPoolID ¶
SetIPPoolID ...
func (*SGMailV3) SetMailSettings ¶
func (s *SGMailV3) SetMailSettings(mailSettings *MailSettings) *SGMailV3
SetMailSettings ...
func (*SGMailV3) SetTemplateID ¶
SetTemplateID ...
func (*SGMailV3) SetTrackingSettings ¶
func (s *SGMailV3) SetTrackingSettings(trackingSettings *TrackingSettings) *SGMailV3
SetTrackingSettings ...
type SandboxModeSetting ¶
type SandboxModeSetting struct { Enable *bool `json:"enable,omitempty"` ForwardSpam *bool `json:"forward_spam,omitempty"` SpamCheck *SpamCheckSetting `json:"spam_check,omitempty"` }
SandboxModeSetting ...
func NewSandboxModeSetting ¶
func NewSandboxModeSetting(enable bool, forwardSpam bool, spamCheck *SpamCheckSetting) *SandboxModeSetting
NewSandboxModeSetting ...
type Setting ¶
type Setting struct {
Enable *bool `json:"enable,omitempty"`
}
Setting enables the mail settings
type SpamCheckSetting ¶
type SpamCheckSetting struct { Enable *bool `json:"enable,omitempty"` SpamThreshold int `json:"threshold,omitempty"` PostToURL string `json:"post_to_url,omitempty"` }
SpamCheckSetting holds spam settings and which can be enable or disable and contains spamThreshold value
func (*SpamCheckSetting) SetEnable ¶
func (s *SpamCheckSetting) SetEnable(enable bool) *SpamCheckSetting
SetEnable ...
func (*SpamCheckSetting) SetPostToURL ¶
func (s *SpamCheckSetting) SetPostToURL(postToURL string) *SpamCheckSetting
SetPostToURL ...
func (*SpamCheckSetting) SetSpamThreshold ¶
func (s *SpamCheckSetting) SetSpamThreshold(spamThreshold int) *SpamCheckSetting
SetSpamThreshold ...
type SubscriptionTrackingSetting ¶
type SubscriptionTrackingSetting struct { Enable *bool `json:"enable,omitempty"` Text string `json:"text,omitempty"` Html string `json:"html,omitempty"` SubstitutionTag string `json:"substitution_tag,omitempty"` }
SubscriptionTrackingSetting ...
func NewSubscriptionTrackingSetting ¶
func NewSubscriptionTrackingSetting() *SubscriptionTrackingSetting
NewSubscriptionTrackingSetting ...
func (*SubscriptionTrackingSetting) SetEnable ¶
func (s *SubscriptionTrackingSetting) SetEnable(enable bool) *SubscriptionTrackingSetting
SetEnable ...
func (*SubscriptionTrackingSetting) SetHTML ¶
func (s *SubscriptionTrackingSetting) SetHTML(html string) *SubscriptionTrackingSetting
SetHTML ...
func (*SubscriptionTrackingSetting) SetSubstitutionTag ¶
func (s *SubscriptionTrackingSetting) SetSubstitutionTag(subTag string) *SubscriptionTrackingSetting
SetSubstitutionTag ...
func (*SubscriptionTrackingSetting) SetText ¶
func (s *SubscriptionTrackingSetting) SetText(text string) *SubscriptionTrackingSetting
SetText ...
type TrackingSettings ¶
type TrackingSettings struct { ClickTracking *ClickTrackingSetting `json:"click_tracking,omitempty"` OpenTracking *OpenTrackingSetting `json:"open_tracking,omitempty"` SubscriptionTracking *SubscriptionTrackingSetting `json:"subscription_tracking,omitempty"` GoogleAnalytics *GaSetting `json:"ganalytics,omitempty"` BCC *BccSetting `json:"bcc,omitempty"` BypassListManagement *Setting `json:"bypass_list_management,omitempty"` SandboxMode *SandboxModeSetting `json:"sandbox_mode,omitempty"` }
TrackingSettings holds tracking settings and mail settings
func (*TrackingSettings) SetClickTracking ¶
func (t *TrackingSettings) SetClickTracking(clickTracking *ClickTrackingSetting) *TrackingSettings
SetClickTracking ...
func (*TrackingSettings) SetGoogleAnalytics ¶
func (t *TrackingSettings) SetGoogleAnalytics(googleAnalytics *GaSetting) *TrackingSettings
SetGoogleAnalytics ...
func (*TrackingSettings) SetOpenTracking ¶
func (t *TrackingSettings) SetOpenTracking(openTracking *OpenTrackingSetting) *TrackingSettings
SetOpenTracking ...
func (*TrackingSettings) SetSubscriptionTracking ¶
func (t *TrackingSettings) SetSubscriptionTracking(subscriptionTracking *SubscriptionTrackingSetting) *TrackingSettings
SetSubscriptionTracking ...