import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
mailgun: {
type: "app",
app: "mailgun",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.mailgun.$auth.region && this.mailgun.$auth.region === "EU" ? "api.eu" : "api"}.mailgun.net/v3/domains`,
auth: {
username: `api`,
password: `${this.mailgun.$auth.api_key}`,
},
})
},
})
Mailgun uses API keys for authentication. When you connect your Mailgun account, Pipedream securely stores the keys so you can easily authenticate to Mailgun APIs in both code and no-code steps.
Get your API Key in the Control Panel, specifically in Settings > API Keys. More info in docs.
If your Mailgun account resides in the EU, choose the EU option in the Region field. Otherwise, choose the US (non-EU) region.