Honza Hommer
7 years ago
No known key found for this signature in database
GPG Key ID: 5EBDE8E7E1A00ACA
1 changed files with
17 additions and
8 deletions
-
notify/mailgun.sh
|
|
|
@ -28,14 +28,23 @@ mailgun_send() { |
|
|
|
_saveaccountconf_mutable MAILGUN_API_KEY "$MAILGUN_API_KEY" |
|
|
|
|
|
|
|
MAILGUN_REGION="${MAILGUN_REGION:-$(_readaccountconf_mutable MAILGUN_REGION)}" |
|
|
|
case "$MAILGUN_REGION" in |
|
|
|
[Uu][Ss] | "") |
|
|
|
if [ -z "$MAILGUN_REGION" ]; then |
|
|
|
MAILGUN_REGION="" |
|
|
|
_debug "The MAILGUN_REGION is not set, so use the default us region." |
|
|
|
fi |
|
|
|
MAILGUN_REGION="" |
|
|
|
_MAILGUN_BASE="https://api.mailgun.net/v3" |
|
|
|
else |
|
|
|
;; |
|
|
|
[Ee][Uu]) |
|
|
|
_saveaccountconf_mutable MAILGUN_REGION "$MAILGUN_REGION" |
|
|
|
_MAILGUN_BASE="https://api.eu.mailgun.net/v3" |
|
|
|
fi |
|
|
|
_MAILGUN_BASE="https://api.$MAILGUN_REGION.mailgun.net/v3" |
|
|
|
;; |
|
|
|
*) |
|
|
|
_err "$MAILGUN_REGION is not a valid region." |
|
|
|
return 1 |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
MAILGUN_TO="${MAILGUN_TO:-$(_readaccountconf_mutable MAILGUN_TO)}" |
|
|
|
if [ -z "$MAILGUN_TO" ]; then |
|
|
|
|