Skip to content

Instantly share code, notes, and snippets.

@anthony2025
Created September 8, 2017 19:10
Show Gist options
  • Save anthony2025/c857e073c6dacd4ea1f6cefe72d2112a to your computer and use it in GitHub Desktop.
Save anthony2025/c857e073c6dacd4ea1f6cefe72d2112a to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "requesting email notification, it might take a few minutes to arrive"
# indentation is weird on this function
generate_email_parameters() {
cat <<EOF
{
"userEmail": "$USER_EMAIL",
"jobName": "$JOB_NAME",
"startTime": "$START_TIME",
"endTime": "$END_TIME",
"exitCode": "$EXIT_CODE"
}
EOF
}
curl -i \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization:$TOKEN" \
-X POST --data "$(generate_email_parameters)" "https:/api/email/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment