chore: add new feature for the ai generate template

This commit is contained in:
mahyargdz
2025-07-31 11:52:00 +03:30
parent 48166e3b6b
commit 6c1904cb60
17 changed files with 622 additions and 459 deletions
+1 -3
View File
@@ -17,7 +17,7 @@ import { UserRepository } from "../../users/repositories/user.repository";
import { EMAIL_QUEUE_CONSTANTS } from "../constants/email-events.constant";
import { BulkActionDto, BulkActionType } from "../DTO/bulk-actions.dto";
import { MessageListQueryDto, SearchMessagesQueryDto } from "../DTO/email-query.dto";
import { EmailRecipientDto, EmailType, SendEmailDto, UpdateDraftDto } from "../DTO/send-email.dto";
import { EmailRecipientDto, SendEmailDto, UpdateDraftDto } from "../DTO/send-email.dto";
import { PriorityEnum } from "../enums/email-header.enum";
import { IEmailMap } from "../interfaces/email-map.interface";
@@ -38,8 +38,6 @@ export class EmailService {
//########################################################
async sendEmail(wildduckUserId: string, userId: string, sendEmailDto: SendEmailDto) {
this.logger.log(`Sending ${EmailType.GENERAL} email from user ${wildduckUserId} to ${sendEmailDto.to.map((t) => t.address).join(", ")}`);
const user = await this.userRepository.findOne({ wildduckUserId, deletedAt: null }, { populate: ["business"] });
if (!user) throw new BadRequestException(EmailMessage.USER_NOT_FOUND);
this.logger.log(`Processing email through business template for business: ${user.business.id}`);