Last active
May 24, 2019 10:04
-
-
Save akfaew/6ff2da8dba7f5577602e379150e94bee to your computer and use it in GitHub Desktop.
GeekMail curl.sh Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEMPLATE=$(cat <<'END_TEMPLATE' | sed ':a;N;$!ba;s/\n/\\n/g' | |
To: {{ .To }} | |
Subject: Hello world! | |
{{ if .Name }}Hey {{ .Name }},{{ else }}Hey there,{{ end }} | |
I'm happy that you joined us. | |
-- | |
Author | |
END_TEMPLATE | |
) | |
curl -X POST https://geekmail.app/api/1.0/draft/create \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"user_token":"TOKEN", | |
"template":'"\"$TEMPLATE\""', | |
"vars":{ | |
"To":"John Doe <[email protected]>", | |
"Name":"John" | |
}, | |
"labels":["GeekMail"] | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment