fix(server): avoid job fail if mail is not configured (#12306)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Improved email notification handling to prevent errors from interrupting other processes when sending emails is not possible.
- **Refactor**
  - Updated internal email sending logic across notifications and workspace features for more robust operation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-05-20 02:49:49 +00:00
parent acce1fbd99
commit 42d527251a
6 changed files with 33 additions and 19 deletions
@@ -6,6 +6,9 @@ import { MailName } from '../../mails';
export class MockMailer {
send = Sinon.createStubInstance(Mailer).send.resolves(true);
trySend(command: Jobs['notification.sendMail']) {
return this.send(command, true);
}
last<Mail extends MailName>(
name: Mail