emailer/README.md

2.6 KiB

Emailer

Resource

{
    "From":"sender email",
    "TO": ["array of receiver emails"],
    "Title": "email subject",
    "Body": {
        "App": {
            "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": ["begining lines (optional)"],
        "Content": "markdown content (optional)",
        "Outros": ["closing lines (optional)"],
        "Actions": [
            {
                "Instructions": "text before action (optional)",
                "InviteCode": "invitation code, only one of `Button`/`InviteCode` should exist (optional)",
                "Button": {
                    "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": "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)"
    }
}

Example:

{
    "From":"test@kumoly.io",
    "TO": ["evan.yf.chen@ibm.com","test@kumoly.io"],
    "Title": "台新人壽通知",
    "Body": {
        "App":{
            "Theme": "#d70c18",
            "FooterColor": "#ffffff"
        },
        "Intros": ["感謝您使用台新人壽服務"],
        "Actions": [
            {
                "Button": {
                    "Text": "前往保護專區",
                    "Link": "https://www.taishinlife.com.tw/",
                }
            }
        ],
        "Greeting": "您好",
        "Receiver": "保戶",
        "Signature": "祝您有個愉快的一天",
        "Sender": "台新人壽"
    }
}

Start

emailer.exe -addr 127.0.0.1:8000 -link https://www.taishinlife.com.tw/ -logo https://www.taishinlife.com.tw/assets/images/ui/site-header/taishin/logo.svg -name "台新人壽" -pretty