hunk.code_window:   constructor(
       private subscriberPreferenceRepository: SubscriberPreferenceRepository,
       private getSubscriberTemplatePreference: GetSubscriberTemplatePreference,
       private notificationTemplateRepository: NotificationTemplateRepository
     ) {}
     async execute(command: UpdateSubscriberPreferenceCommand): Promise<ISubscriberPreferenceResponse> {
  
hunk.labels: keep keep keep replace keep keep keep
hunk.after_edit:     private notificationTemplateRepository: NotificationTemplateRepository,
       @Inject(ANALYTICS_SERVICE) private analyticsService: AnalyticsService
  
hunk.file_path: apps/api/src/app/widgets/usecases/update-subscriber-preference/update-subscriber-preference.usecase.ts
hunk.type: replace
file: import {
    ChannelTypeEnum,
    IEmailOptions,
    IEmailProvider,
    ISendMessageSuccessResponse,
  } from '@novu/stateless';
  import nodemailer, { Transporter } from 'nodemailer';
  import DKIM from 'nodemailer/lib/dkim';
  
  export class NodemailerProvider implements IEmailProvider {
    id = 'nodemailer';
  
    channelType = ChannelTypeEnum.EMAIL as ChannelTypeEnum.EMAIL;
  
    private transports: Transporter;
  
    constructor(
      private config: {
        from: string;
        host: string;
        port: number;
        secure: boolean;
        user: string;
        password: string;
        dkim?: DKIM.SingleKeyOptions | undefined;
      }
    ) {
      let dkim = this.config.dkim;
  
      if (!dkim?.domainName || !dkim?.privateKey || !dkim?.keySelector) {
        dkim = undefined;
      }
  
      this.transports = nodemailer.createTransport({
        host: this.config.host,
        port: this.config.port,
        secure: this.config.secure,
        auth: {
          user: this.config.user,
          pass: this.config.password,
        },
        dkim,
      });
    }
  
    async sendMessage(
      options: IEmailOptions
    ): Promise<ISendMessageSuccessResponse> {
      const info = await this.transports.sendMail({
        from: options.from || this.config.from,
        to: options.to,
        subject: options.subject,
        html: options.html,
        text: options.text,
        attachments: options.attachments?.map((attachment) => ({
          filename: attachment?.name,
          content: attachment.file,
          contentType: attachment.mime,
        })),
      });
  
      return {
        id: info?.messageId,
        date: new Date().toISOString(),
      };
    }
  }
  