feat: configure Mailgun EU API endpoint

Add explicit EU API endpoint configuration for Mailgun client to ensure emails
are sent through the correct regional API server. This is required for accounts
created in the EU region.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-12-30 17:44:16 +01:00
parent 1c98b3b2e6
commit 7b4e1b2710

View File

@@ -21,14 +21,17 @@ function getMailgunClient() {
} }
const apiKey = process.env.MAILGUN_API_KEY; const apiKey = process.env.MAILGUN_API_KEY;
const domain = process.env.MAILGUN_DOMAIN || 'rezije.app';
if (!apiKey) { if (!apiKey) {
throw new Error('MAILGUN_API_KEY environment variable is not set'); throw new Error('MAILGUN_API_KEY environment variable is not set');
} }
const mailgun = new Mailgun(formData); const mailgun = new Mailgun(formData);
mailgunClient = mailgun.client({ username: 'api', key: apiKey }); mailgunClient = mailgun.client({
username: 'api',
key: apiKey,
url: "https://api.eu.mailgun.net"
});
return mailgunClient; return mailgunClient;
} }