aboutsummaryrefslogtreecommitdiffstats
path: root/start/events.js
diff options
context:
space:
mode:
Diffstat (limited to 'start/events.js')
-rw-r--r--start/events.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/start/events.js b/start/events.js
deleted file mode 100644
index a99afd5..0000000
--- a/start/events.js
+++ /dev/null
@@ -1,25 +0,0 @@
1const Event = use('Event');
2const Mail = use('Mail');
3const Env = use('Env');
4
5Event.on('forgot::password', async ({ user, token }) => {
6 const body = `
7Hello ${user.username},
8we received a request to reset your Ferdium account password.
9Use the link below to reset your password. If you didn't requested that your password be reset, please ignore this message.
10
11${Env.get('APP_URL')}/user/reset?token=${encodeURIComponent(token)}
12
13This message was sent automatically. Please do not reply.
14`;
15 console.log('Sending message', body);
16 try {
17 await Mail.raw(body, (message) => {
18 message.subject('[Ferdium] Reset your password');
19 message.from(Env.get('MAIL_SENDER'));
20 message.to(user.email);
21 });
22 } catch (e) {
23 console.log(`Couldn't send mail: ${e}`);
24 }
25});