@chevre/domain 28.0.0-alpha.38 → 28.0.0-alpha.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import type { SendEmailMessageActionRepo } from '../../repo/action/sendEmailMess
3
3
  import type { MessageRepo } from '../../repo/message';
4
4
  import type { ProjectRepo } from '../../repo/project';
5
5
  import type { IntegrationSettingRepo } from '../../repo/setting/integration';
6
+ import type { SettingRepo } from '../../repo/setting';
6
7
  /**
7
8
  * https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html
8
9
  */
@@ -17,5 +18,6 @@ declare function sendEmailMessage(params: factory.task.sendEmailMessage.IActionA
17
18
  message: MessageRepo;
18
19
  project: ProjectRepo;
19
20
  integrationSetting: IntegrationSettingRepo;
21
+ setting: SettingRepo;
20
22
  }) => Promise<void>;
21
23
  export { sendEmailMessage };
@@ -41,9 +41,14 @@ function createMailData(params) {
41
41
  project: { id: project.id }
42
42
  });
43
43
  }
44
+ const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['defaultSenderEmail']);
45
+ if (typeof setting?.defaultSenderEmail !== 'string') {
46
+ throw new factory_1.factory.errors.NotFound('setting.defaultSenderEmail');
47
+ }
44
48
  const emailMessageFrom = {
45
49
  name: emailMessage.sender.name,
46
- email: emailMessage.sender.email
50
+ // email: emailMessage.sender.email // 指定されたsenderEmailを適用しない(2026-10-19~)
51
+ email: setting.defaultSenderEmail // 強制的にグローバル設定を適用(2026-10-19~)
47
52
  };
48
53
  // プロジェクト設定対応(2023-08-21~)
49
54
  const senderEmailByProjectSettings = project.settings?.sendEmailMessage?.sender?.email;
@@ -5,6 +5,7 @@ const sendEmailMessage_1 = require("../../repo/action/sendEmailMessage");
5
5
  const message_1 = require("../../repo/message");
6
6
  const project_1 = require("../../repo/project");
7
7
  const integration_1 = require("../../repo/setting/integration");
8
+ const setting_1 = require("../../repo/setting");
8
9
  const notification_1 = require("../notification");
9
10
  /**
10
11
  * タスク実行関数
@@ -18,7 +19,8 @@ function call(params) {
18
19
  actions: { sendEmailMessage: new sendEmailMessage_1.SendEmailMessageActionRepo(connection) },
19
20
  message: new message_1.MessageRepo(connection),
20
21
  project: new project_1.ProjectRepo(connection),
21
- integrationSetting: new integration_1.IntegrationSettingRepo({ connection })
22
+ integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
23
+ setting: new setting_1.SettingRepo(connection)
22
24
  });
23
25
  };
24
26
  }
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0-alpha.38"
91
+ "version": "28.0.0-alpha.39"
92
92
  }