From f3b3e063293ba623446aaf1f2b90089af9fa7a21 Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Sun, 25 Jul 2021 13:28:33 +0900
Subject: [PATCH] fix email notification bug

---
 src/services/create-notification.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/services/create-notification.ts b/src/services/create-notification.ts
index 261b36814c..7d2726971f 100644
--- a/src/services/create-notification.ts
+++ b/src/services/create-notification.ts
@@ -1,6 +1,6 @@
 import { publishMainStream } from './stream';
 import pushSw from './push-notification';
-import { Notifications, Mutings, UserProfiles } from '../models';
+import { Notifications, Mutings, UserProfiles, Users } from '../models';
 import { genId } from '@/misc/gen-id';
 import { User } from '../models/entities/user';
 import { Notification } from '../models/entities/notification';
@@ -53,8 +53,8 @@ export async function createNotification(
 		publishMainStream(notifieeId, 'unreadNotification', packed);
 
 		pushSw(notifieeId, 'notification', packed);
-		if (type === 'follow') sendEmailNotification.follow(notifieeId, data);
-		if (type === 'receiveFollowRequest') sendEmailNotification.receiveFollowRequest(notifieeId, data);
+		if (type === 'follow') sendEmailNotification.follow(notifieeId, await Users.findOneOrFail(data.notifierId!));
+		if (type === 'receiveFollowRequest') sendEmailNotification.receiveFollowRequest(notifieeId, await Users.findOneOrFail(data.notifierId!));
 	}, 2000);
 
 	return notification;