refactor(core): Tear down internal hooks (no-changelog) (#10340)

This commit is contained in:
Iván Ovejero
2024-08-12 10:13:15 +02:00
committed by GitHub
parent 78984986a6
commit 6b52bebf52
23 changed files with 95 additions and 98 deletions

View File

@@ -8,7 +8,6 @@ import { GlobalConfig } from '@n8n/config';
import type { User } from '@db/entities/User';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { UserRepository } from '@db/repositories/user.repository';
import { InternalHooks } from '@/InternalHooks';
import { Logger } from '@/Logger';
import { UrlService } from '@/services/url.service';
import { InternalServerError } from '@/errors/response-errors/internal-server.error';
@@ -112,10 +111,10 @@ export class UserManagementMailer {
this.logger.info('Sent workflow shared email successfully', { sharerId: sharer.id });
Container.get(InternalHooks).onUserTransactionalEmail({
user_id: sharer.id,
message_type: 'Workflow shared',
public_api: false,
Container.get(EventService).emit('user-transactional-email-sent', {
userId: sharer.id,
messageType: 'Workflow shared',
publicApi: false,
});
return result;
@@ -167,10 +166,10 @@ export class UserManagementMailer {
this.logger.info('Sent credentials shared email successfully', { sharerId: sharer.id });
Container.get(InternalHooks).onUserTransactionalEmail({
user_id: sharer.id,
message_type: 'Credentials shared',
public_api: false,
Container.get(EventService).emit('user-transactional-email-sent', {
userId: sharer.id,
messageType: 'Credentials shared',
publicApi: false,
});
return result;