Documentation ¶
Index ¶
- Constants
- func FormatEmail(m mail.Address) string
- func FormatTime(t time.Time) string
- type Attachment
- type Client
- func (c *Client) Call(endpoint string, data map[string]interface{}, results interface{}) error
- func (p *Client) MessagesSend(msg *Message, opts ...SendOpt) ([]SendResult, error)
- func (p *Client) MessagesSendTemplate(name string, content []Variable, msg *Message, opts ...SendOpt) ([]SendResult, error)
- func (p *Client) Ping() (bool, error)
- func (p *Client) TemplatesInfo(name string) (Template, error)
- func (p *Client) TemplatesList(label string) ([]Template, error)
- func (p *Client) TemplatesRender(name string, content []Variable, vars []Variable) (interface{}, error)
- type ErrorResult
- type MergeLanguage
- type Message
- func (m *Message) AddRecipient(t SendType, r Recipient) *Message
- func (m *Message) BCC(email string, name string) *Message
- func (m *Message) CC(email string, name string) *Message
- func (m *Message) To(email string, name string) *Message
- func (m *Message) WithValue(key string, content interface{}) *Message
- func (m *Message) WithValues(vals map[string]interface{}) *Message
- type RcptMergeVars
- type RcptMetadata
- type Recipient
- type RejectType
- type SendOpt
- type SendResult
- type SendStatus
- type SendType
- type Template
- type Variable
Constants ¶
View Source
const ( SendTo SendType = "to" SendCC = "cc" SendBCC = "bcc" )
View Source
const ( MessageSent SendStatus = "sent" MessageQueued = "queued" MessageScheduled = "scheduled" MessageRejected = "rejected" MessageInvalid = "invalid" ClientError = "error" )
View Source
const ( RejectedHardBounce RejectType = "hard-bounce" RejectedSoftBounce = "soft-bounce" RejectedSpam = "spam" RejectedUnsub = "unsub" RejectedCustom = "custom" RejectedInvalidSender = "invalid-sender" RejectedInvalid = "invalid" RejectedModeLimit = "test-mode-limit" RejectedRule = "rule" )
View Source
const (
DateFormat string = "2006-01-02 15:04:05"
)
View Source
const ENDPOINT string = "https://mandrillapp.com/api/1.0/%s.json"
Variables ¶
This section is empty.
Functions ¶
func FormatEmail ¶
func FormatTime ¶
Types ¶
type Attachment ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) MessagesSend ¶
func (p *Client) MessagesSend(msg *Message, opts ...SendOpt) ([]SendResult, error)
func (*Client) MessagesSendTemplate ¶
type ErrorResult ¶
type ErrorResult struct { Status SendStatus `json:"status"` Code int `json:"code"` Name string `json:"name"` Message string `json:"message"` }
func (*ErrorResult) Error ¶
func (e *ErrorResult) Error() string
type MergeLanguage ¶
type MergeLanguage string
const ( Mailchimp MergeLanguage = "mailchimp" Handlebars = "handlebars" )
type Message ¶
type Message struct { Html string `json:"html,omitempty"` Text string `json:"text,omitempty"` Subject string `json:"subject,omitempty"` FromEmail string `json:"from_email,omitempty"` FromName string `json:"from_name,omitempty"` Headers map[string]string `json:"headers,omitempty"` Important bool `json:"important,omitempty"` TrackOpens bool `json:"track_opens,omitempty"` TrackClicks bool `json:"track_clicks,omitempty"` AutoText bool `json:"auto_text,omitempty"` AutoHtml bool `json:"auto_html,omitempty"` InlineCSS bool `json:"inline_css,omitempty"` UrlStripQs bool `json:"url_strip_qs,omitempty"` PreserveRecipients bool `json:"preserve_recipients,omitempty"` ViewContentLink bool `json:"view_content_link,omitempty"` BCCAddress string `json:"bcc_address,omitempty"` TrackingDomain string `json:"tracking_domain,omitempty"` SigningDomain string `json:"signing_domain,omitempty"` ReturnPathDomain string `json:"return_path_domain,omitempty"` Merge bool `json:"merge,omitempty"` MergeLanguage MergeLanguage `json:"merge_language,omitempty"` GlobalMergeVars []Variable `json:"global_merge_vars,omitempty"` Tags []string `json:"tags,omitempty"` SubAccount string `json:"sub_account,omitempty"` GoogleAnalyticsDomains []string `json:"google_analytics_domains,omitempty"` GoogleAnalyticsCampaign []string `json:"google_analytics_campaign,omitempty"` Metadata []RcptMetadata `json:"metadata,omitempty"` Recipients []Recipient `json:"to,omitempty"` // built from Recipients MergeVars []RcptMergeVars `json:"merge_vars,omitempty"` RecipientMetadata []RcptMetadata `json:"recipient_metadata,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` Images []Attachment `json:"images,omitempty"` }
func NewMessage ¶
func NewMessage() *Message
func (*Message) WithValues ¶ added in v0.2.0
type RcptMergeVars ¶
type RcptMetadata ¶
type RejectType ¶
type RejectType string
type SendResult ¶
type SendResult struct { Email string `json:"email"` Status SendStatus `json:"status"` RejectReason RejectType `json:"reject_reason"` Id string `json:"id"` }
type SendStatus ¶
type SendStatus string
type Template ¶
type Template struct { Slug string `json:"slug,omitempty"` Name string `json:"name"` Labels []string `json:"labels,omitempty"` Code string `json:"code,omitempty"` Subject string `json:"subject,omitempty"` FromEmail string `json:"from_email,omitempty"` FromName string `json:"from_name,omitempty"` Text string `json:"text,omitempty"` PublishCode string `json:"publish_code,omitempty"` PublishSubject string `json:"publish_subject,omitempty"` PublishFromEmail string `json:"publish_from_email,omitempty"` PublishFromName string `json:"publish_from_name,omitempty"` PublishText string `json:"publish_text,omitempty"` PublishedAt string `json:"published_at,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Publish bool `json:"publish,omitempty"` }
Click to show internal directories.
Click to hide internal directories.