fix: user invite email not sending and null variables

- Add missing BullModule queue registration and BullBoardModule to UsersModule
- Add invitingUser to event payloads to track who sent the invite
- Fix incorrect global variable in SendInviteUsersMailMessage (__views_dir -> __images_dirname)
- Use invitingUser as fromUser instead of invited user in email
- Update processors to use BullMQ pattern

Fixes issues:
1. Email not sending due to missing queue/processor registration
2. Null variables in email (firstName/lastName) because fromUser was the invited user
3. Image attachment failing due to wrong path
This commit is contained in:
Ahmed Bouhuolia
2026-02-14 00:31:28 +02:00
parent 9204b76346
commit 66cb0521e5
17 changed files with 98 additions and 79 deletions

View File

@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { InjectQueue } from '@nestjs/bull';
import { Queue } from 'bull';
import { InjectQueue } from '@nestjs/bullmq';
import { Queue } from 'bullmq';
import { events } from '@/common/events/events';
import { OnEvent } from '@nestjs/event-emitter';
import {
@@ -29,6 +29,7 @@ export default class InviteSendMainNotificationSubscribe {
async sendMailNotification({
invite,
user,
invitingUser,
}: IUserInviteTenantSyncedEventPayload) {
const tenant = await this.tenancyContext.getTenant();
const authedUser = await this.tenancyContext.getSystemUser();
@@ -37,7 +38,7 @@ export default class InviteSendMainNotificationSubscribe {
const userId = authedUser.id;
this.sendInviteMailQueue.add(SendInviteUserMailJob, {
fromUser: user,
fromUser: invitingUser,
invite,
userId,
organizationId,