Debian Codegraph @

dm/mail.go

raw symbols SCIP
1 package dm
2
3 import (
4 "net/http"
5
6 "github.com/denverdino/aliyungo/common"
7 )
8
9 type SendEmailArgs struct {
10 AccountName string
11 AddressType string
12 }
13
14 type SendBatchMailArgs struct {
15 SendEmailArgs
16 TemplateName string
17 ReceiverName string
18 TagName string
19 }
20
21 //remember to setup the accountName in your aliyun console
22 //addressType should be "1" or "0",
23 //0:random address, it's recommanded
24 //1:sender's address
25 //tagName is optional, you can use "" if you don't wanna use it
26 //please set the receiverName and template in the console of Aliyun before you call this API,if you use tagName, you should set it as well
27
28 func (this *Client) SendBatchMail(args *SendBatchMailArgs) error {
29 return this.InvokeByAnyMethod(http.MethodPost, BatchSendMail, "", args, &common.Response{})
30 }
31
32 type SendSingleMailArgs struct {
33 SendEmailArgs
34 ReplyToAddress bool
35 ToAddress string
36 FromAlias string
37 Subject string
38 HtmlBody string
39 TextBody string
40 }
41
42 //remember to setup the accountName in your aliyun console
43 //addressType should be "1" or "0",
44 //0:random address, it's recommanded
45 //1:sender's address
46 //please set the receiverName and template in the console of Aliyun before you call this API,if you use tagName, you should set it as well
47
48 //fromAlias, subject, htmlBody, textBody are optional
49
50 func (this *Client) SendSingleMail(args *SendSingleMailArgs) error {
51 return this.InvokeByAnyMethod(http.MethodPost, SingleSendMail, "", args, &common.Response{})
52 }