From 9ca9b7a1445ebb829a850bb7815c1c1003359fc9 Mon Sep 17 00:00:00 2001 From: Kentaro Fukunaga Date: Thu, 29 Feb 2024 06:36:23 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20790:=20Author=E3=81=AENotificatio?= =?UTF-8?q?n=E3=83=95=E3=83=A9=E3=82=B0=E3=82=92=E8=A6=8B=E3=81=A6?= =?UTF-8?q?=E3=82=BF=E3=82=B9=E3=82=AF=E5=AE=8C=E4=BA=86=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E9=80=81=E4=BF=A1=E5=85=88=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3818: 対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3818) - AuthorのNotificationフラグがOFFのときには、Authorに対してタスク完了通知メールが送信されないよう修正しました。 ## レビューポイント - 動作確認項目に不足はないか? ## 動作確認状況 - ローカルで確認しました - AuthorのNotificationON時にはメール宛先に入っており、OFF時には宛先から外れること - TypistはNotificationON/OFF関わらずメール宛先に入っていること --- dictation_server/src/features/tasks/tasks.service.ts | 5 +++-- dictation_server/src/gateways/sendgrid/sendgrid.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dictation_server/src/features/tasks/tasks.service.ts b/dictation_server/src/features/tasks/tasks.service.ts index 7b7c127..898a8f9 100644 --- a/dictation_server/src/features/tasks/tasks.service.ts +++ b/dictation_server/src/features/tasks/tasks.service.ts @@ -435,7 +435,7 @@ export class TasksService { `author_id not found. audioFileId: ${audioFileId}. account_id: ${user.account_id}`, ); } - const { external_id: authorExternalId } = + const { external_id: authorExternalId, notification: authorNotification } = await this.usersRepository.findUserByAuthorId( context, task.file.author_id, @@ -454,6 +454,7 @@ export class TasksService { ]); // メール送信に必要な情報を取得 + // Author通知ON/OFF関わらずAuthor名は必要なため、情報の取得は行う const author = usersInfo.find((x) => x.id === authorExternalId); if (!author) { throw new Error(`author not found. id=${authorExternalId}`); @@ -488,7 +489,7 @@ export class TasksService { // メール送信 this.sendgridService.sendMailWithU117( context, - authorEmail, + authorNotification ? authorEmail : null, typistEmail, authorName, task.file.file_name.replace('.zip', ''), diff --git a/dictation_server/src/gateways/sendgrid/sendgrid.service.ts b/dictation_server/src/gateways/sendgrid/sendgrid.service.ts index 17fa39b..ac9a5df 100644 --- a/dictation_server/src/gateways/sendgrid/sendgrid.service.ts +++ b/dictation_server/src/gateways/sendgrid/sendgrid.service.ts @@ -875,7 +875,7 @@ export class SendGridService { */ async sendMailWithU117( context: Context, - authorEmail: string, + authorEmail: string | null, typistEmail: string, authorName: string, fileName: string, @@ -903,7 +903,7 @@ export class SendGridService { // メールを送信する await this.sendMail( context, - [authorEmail, typistEmail], + [authorEmail, typistEmail].filter((x): x is string => x !== null), // authorEmailがnullの場合は除外する [], this.mailFrom, subject,