Documentation ¶
Index ¶
- func SendComplexMessage(domain, apiKey string) (string, error)
- func SendScheduledMessage(domain, apiKey string) (string, error)
- func SendTaggedMessage(domain, apiKey string) (string, error)
- type Mailgun
- func (mgObj *Mailgun) SendBatchEmail(from, subject, text, template string, to map[string]interface{})
- func (mgObj *Mailgun) SendBatchMessageLessThan1k(from, subject, text, template string, to map[string]interface{})
- func (mgObj *Mailgun) SendSimpleMessage(from, subject, text, template, to string)
- func (mgObj *Mailgun) SendSimpleMessageWithRecipientAndVariables(from, subject, text, template string, to map[string]interface{}) error
- func (mgObj *Mailgun) SendSimpleMessageWithTemplateVariables(from, subject, text, template, to string, templateVar map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendComplexMessage ¶
func SendScheduledMessage ¶
Types ¶
type Mailgun ¶
func (*Mailgun) SendBatchEmail ¶
func (mgObj *Mailgun) SendBatchEmail(from, subject, text, template string, to map[string]interface{})
当大于1000条的时候,自动分成若干个1000条的发出去。
func (*Mailgun) SendBatchMessageLessThan1k ¶
func (mgObj *Mailgun) SendBatchMessageLessThan1k(from, subject, text, template string, to map[string]interface{})
https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending The maximum number of recipients allowed for Batch Sending is 1,000.
to的形式:{ "user1@example.com" : {"var1": "ABC123456789", "var2": "adfsa"}, "user2@example.com" : {"var1": "ZXY987654321", "var2": "34123"} }
func (*Mailgun) SendSimpleMessage ¶
func (*Mailgun) SendSimpleMessageWithRecipientAndVariables ¶ added in v1.0.13
func (*Mailgun) SendSimpleMessageWithTemplateVariables ¶ added in v1.0.13
func (mgObj *Mailgun) SendSimpleMessageWithTemplateVariables(from, subject, text, template, to string, templateVar map[string]interface{}) error
如mailgun template里的variable是 {{var}} 则用m.AddTemplateVariable(var, value)来设置所有模板,所有的收件人的邮件内容都是一样的 如mailgun template里的variable是 {%recipient.var%} 则用m.AddRecipientAndVariables(r, {"var":value})来设置,每个收件人的邮件内容都是独特的
Click to show internal directories.
Click to hide internal directories.