update mailgun info

pull/1281/head
Kelly 2020-08-11 21:57:57 -07:00
parent 5049bdb000
commit c31360cd63
1 changed files with 3 additions and 2 deletions

View File

@ -185,7 +185,8 @@ numberOfCrits
The example below uses the Mailgun API to send an alert email when more than 3 critical statuses occur within 10 minutes.
{{% note %}} To view your Mailgun API keys, sign in to Mailjet and open [Account Security - API security](https://app.mailgun.com/app/account/security/api_keys). Mailgun requires that you specify a domain via Mailgun. For domains created in the US region, use `https://api.mailgun.net/v3`. For domains created in the EU region, use `https://api.eu.mailgun.net/v3`. Mailgun currently validates emails for the US region only. If you're using a free version of Mailgun, a domain is created when you set up your account and you can set up a maximum of five authorized recipients. To view your Mailgun domains, sign in to Mailgun and view the [Domains page](https://app.mailgun.com/app/sending/domains).
{{% note %}} To view your Mailgun API keys, sign in to Mailjet and open [Account Security - API security](https://app.mailgun.com/app/account/security/api_keys). <br>
Mailgun requires that a domain be specified via Mailgun. A domain is automatically created for you when you first set up your account. You must include this domain in your url endpoint (for example, `https://api.mailgun.net/v3/YOUR_DOMAIN` or `https://api.eu.mailgun.net/v3/YOUR_DOMAIN`. If you're using a free version of Mailgun, you can set up a maximum of five authorized recipients (to receive email alerts) for your domain. To view your Mailgun domains, sign in to Mailgun and view the [Domains page](https://app.mailgun.com/app/sending/domains).
{{% /note %}}
```js
@ -208,7 +209,7 @@ numberOfCrits = from(bucket: "_monitoring")
numberOfCrits
|> map(fn: (r) =>
(if r._value > 1 then {r with _value: http.post(url: "https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages", headers: {Authorization: "Basic api:<your-private-api-key"}, data: bytes(v: "{
(if r._value > 1 then {r with _value: http.post(url: "https://api.mailgun.net/v3/YOUR_DOMAIN/messages", headers: {Authorization: "Basic api:<your-private-api-key"}, data: bytes(v: "{
from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \
to=YOU@YOUR_DOMAIN_NAME \
to=bar@example.com \