Merged PR 790: AuthorのNotificationフラグを見てタスク完了メールの送信先を変更するよう修正
## 概要 [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関わらずメール宛先に入っていること
This commit is contained in:
parent
ce6e09a7d0
commit
9ca9b7a144
@ -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', ''),
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user