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 ```json
{ {
"From":"", "From":"sender email",
"TO": [""], "TO": ["array of receiver emails"],
"Title": "台新人壽通知", "Title": "email subject",
"Body": { "Body": {
"App": { "App": {
"Name":"", "Name":"site name (optional)",
"Link":"", "Link":"site link (optional)",
"Logo":"", "Logo":"site logo (precedence over site name) (optional)",
"Copyright":"", "Copyright":"site copyright string (default to site name) (optional)",
"TroubleText":"", "TroubleText":"help string for button link (optional)",
"Theme": "", "Theme": "email back groud color (default #F2F4F6) (optional)",
"TitleColor": "", "TitleColor": "email site name color (default #2F3133) (optional)",
"FooterColor": "" "FooterColor": "email copyright color (default #AEAEAE) (optional)"
}, },
"Intros": [""], "Intros": ["begining lines (optional)"],
"Content": "", "Content": "markdown content (optional)",
"Outros": [""], "Outros": ["closing lines (optional)"],
"Actions": [ "Actions": [
{ {
"Instructions": "", "Instructions": "text before action (optional)",
"InviteCode": "", "InviteCode": "invitation code, only one of `Button`/`InviteCode` should exist (optional)",
"Button": { "Button": {
"Text": "", "Text": "Button Text, only one of `Button`/`InviteCode` should exist (optional)",
"Link": "", "Link": "Button link url (optional)",
"Color": "", "Color": "Button color (default #3869D4) (optional)",
"TextColor": "" "TextColor": "Button text (default #ffffff) (optional)"
} }
} }
], ],
"Greeting": "", "Greeting": "Greeting text (optional)",
"Receiver": "", "Receiver": "Receiver name, ignored if Greeting is empty (optional)",
"Signature": "", "Signature": "Signature text (default `Best Regards`) (optional)",
"Sender": "" "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.", Copyright: fmt.Sprintf("Copyright © %v %s. All rights reserved.",
time.Now().Year(), fName), time.Now().Year(), fName),
TroubleText: fTroubleText, TroubleText: fTroubleText,
Theme: "#F2F4F6",
TitleColor: "#2F3133",
FooterColor: "#AEAEAE",
}) })
email.SetDailer(gomail.NewDialer(fHost, fPort, fUsr, fPwd)) email.SetDailer(gomail.NewDialer(fHost, fPort, fUsr, fPwd))