Skip to content

Commit

Permalink
Merge pull request #28 from iron-security/feat/configurator
Browse files Browse the repository at this point in the history
fix: send email from EU
  • Loading branch information
hazcod authored Apr 25, 2023
2 parents 53d1db1 + e8c757d commit ca39556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion workers/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function handleContactRequest(event)
}

// request is deemed a success! so try submit the email for sending
const mgResult = await fetch('https://api.mailgun.net/v3/' + MAILGUN_DOMAIN + '/messages', {
const mgResult = await fetch('https://api.eu.mailgun.net/v3/' + MAILGUN_DOMAIN + '/messages', {
method: 'post',
timeout: 10000,
headers: {
Expand Down
6 changes: 3 additions & 3 deletions workers/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function handleQuoteRequest(event)
formData.append('attachment', new Blob([Buffer.from(pdfBytes)], { type: 'application/pdf' }), 'iron-quote.pdf'),
formData.append('h:Reply-To', EMAIL_TO);

const mgResult = await fetch('https://api.mailgun.net/v3/' + MAILGUN_DOMAIN + '/messages', {
const mgResult = await fetch('https://api.eu.mailgun.net/v3/' + MAILGUN_DOMAIN + '/messages', {
method: 'post',
timeout: 10000,
headers: {
Expand All @@ -107,8 +107,8 @@ export async function handleQuoteRequest(event)

// return error if we couldn't send the email
if (! mgResult.ok) {
const mgResponse = await mgResult.json();
console.log('mailgun call failed: ' + mgResult.status + ' ' + mgResult.statusText + ' -> ' + mgResponse.message);
const mgResponse = await mgResult.text();
console.log('mailgun call failed: ' + mgResult.status + ' ' + mgResult.statusText + ' -> ' + mgResponse);
return new Response('500 Server Error', { status: 500 });
}

Expand Down

0 comments on commit ca39556

Please sign in to comment.