Last active
November 21, 2017 17:56
Unhandled send mails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unhandled from 'electron-unhandled'; | |
import mailgunInitializer from 'mailgun-js'; | |
import { APP_VERSION, MAILGUN_PRIVATE, MAILGUN_SERVER } from './config'; | |
const mailgun = mailgunInitializer(({ | |
apiKey: MAILGUN_PRIVATE, | |
domain: MAILGUN_SERVER | |
})); | |
unhandled({ | |
logger: (error) => { | |
const data = { | |
from: 'Fenêtre App <no-reply@fenêt.re>', | |
to: 'support@fenêt.re', | |
subject: '[ERROR] in Fenêtre !', | |
html: ` <h1>Version: ${APP_VERSION}</h1> | |
<h3>${new Date().toLocaleString()}</h3> | |
<p>The following error occured :</p> | |
<pre>${error.stack}</pre>` | |
}; | |
mailgun.messages().send(data, (err) => { /* Handle errors */ }); | |
}, | |
showDialog: !IS_PRODUCTION | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment