master
Evan Chen 2021-12-29 11:20:31 +08:00
parent ff3998c1a4
commit c28a5afb6c
2 changed files with 27 additions and 24 deletions

View File

@ -4,39 +4,39 @@
```json
{
"From":"",
"TO": [""],
"Title": "台新人壽通知",
"From":"sender email",
"TO": ["array of receiver emails"],
"Title": "email subject",
"Body": {
"App": {
"Name":"",
"Link":"",
"Logo":"",
"Copyright":"",
"TroubleText":"",
"Theme": "",
"TitleColor": "",
"FooterColor": ""
"Name":"site name (optional)",
"Link":"site link (optional)",
"Logo":"site logo (precedence over site name) (optional)",
"Copyright":"site copyright string (default to site name) (optional)",
"TroubleText":"help string for button link (optional)",
"Theme": "email back groud color (default #F2F4F6) (optional)",
"TitleColor": "email site name color (default #2F3133) (optional)",
"FooterColor": "email copyright color (default #AEAEAE) (optional)"
},
"Intros": [""],
"Content": "",
"Outros": [""],
"Intros": ["begining lines (optional)"],
"Content": "markdown content (optional)",
"Outros": ["closing lines (optional)"],
"Actions": [
{
"Instructions": "",
"InviteCode": "",
"Instructions": "text before action (optional)",
"InviteCode": "invitation code, only one of `Button`/`InviteCode` should exist (optional)",
"Button": {
"Text": "",
"Link": "",
"Color": "",
"TextColor": ""
"Text": "Button Text, only one of `Button`/`InviteCode` should exist (optional)",
"Link": "Button link url (optional)",
"Color": "Button color (default #3869D4) (optional)",
"TextColor": "Button text (default #ffffff) (optional)"
}
}
],
"Greeting": "",
"Receiver": "",
"Signature": "",
"Sender": ""
"Greeting": "Greeting text (optional)",
"Receiver": "Receiver name, ignored if Greeting is empty (optional)",
"Signature": "Signature text (default `Best Regards`) (optional)",
"Sender": "Sender text (default to site name) (optional)"
}
}
```

View File

@ -74,6 +74,9 @@ func main() {
Copyright: fmt.Sprintf("Copyright © %v %s. All rights reserved.",
time.Now().Year(), fName),
TroubleText: fTroubleText,
Theme: "#F2F4F6",
TitleColor: "#2F3133",
FooterColor: "#AEAEAE",
})
email.SetDailer(gomail.NewDialer(fHost, fPort, fUsr, fPwd))