@punks/backend-entity-manager 0.0.465 → 0.0.467

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,5 +7,5 @@ export declare class SendgridEmailProvider implements IEmailProvider<SendgridEma
7
7
  private readonly logger;
8
8
  constructor(eventsService: EventsService);
9
9
  sendTemplatedEmail<TPayload, TAugmentedPayload>(input: TemplatedEmailInput<TPayload>, template: IEmailTemplate<SendgridEmailTemplateData, TPayload, TAugmentedPayload>, options?: EmailSendOptions): Promise<void>;
10
- sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>): Promise<void>;
10
+ sendHtmlEmail<TPayload>(input: HtmlEmailInput<TPayload>, options?: EmailSendOptions): Promise<void>;
11
11
  }
@@ -6,5 +6,7 @@ export type SendgridSettings = {
6
6
  defaultCc?: string[];
7
7
  defaultBcc?: string[];
8
8
  loggingEnabled?: boolean;
9
+ sandboxMode?: boolean;
10
+ forceDelivery?: boolean;
9
11
  };
10
12
  export declare const sendgridSettings: AppInMemorySettings<SendgridSettings>;
package/dist/esm/index.js CHANGED
@@ -41262,7 +41262,7 @@ let SendgridEmailProvider = class SendgridEmailProvider {
41262
41262
  from: input.from ?? templateData.from,
41263
41263
  to: input.to ?? templateData.to,
41264
41264
  attachments: input.attachments,
41265
- });
41265
+ }, options);
41266
41266
  return;
41267
41267
  }
41268
41268
  const request = removeUndefinedProps({
@@ -41294,26 +41294,26 @@ let SendgridEmailProvider = class SendgridEmailProvider {
41294
41294
  : attachment.content,
41295
41295
  })),
41296
41296
  mailSettings: {
41297
- ...(options?.sandboxMode
41297
+ ...(options?.sandboxMode || sendgridSettings.value.sandboxMode
41298
41298
  ? {
41299
41299
  sandboxMode: {
41300
- enable: options.sandboxMode,
41300
+ enable: true,
41301
41301
  },
41302
41302
  }
41303
41303
  : {}),
41304
- ...(options?.forceDelivery
41304
+ ...(options?.forceDelivery || sendgridSettings.value.forceDelivery
41305
41305
  ? {
41306
41306
  bypassListManagement: {
41307
- enable: options.forceDelivery,
41307
+ enable: true,
41308
41308
  },
41309
41309
  bypassBounceManagement: {
41310
- enable: options.forceDelivery,
41310
+ enable: true,
41311
41311
  },
41312
41312
  bypassUnsubscribeManagement: {
41313
- enable: options.forceDelivery,
41313
+ enable: true,
41314
41314
  },
41315
41315
  bypassSpamManagement: {
41316
- enable: options.forceDelivery,
41316
+ enable: true,
41317
41317
  },
41318
41318
  }
41319
41319
  : {}),
@@ -41343,7 +41343,7 @@ let SendgridEmailProvider = class SendgridEmailProvider {
41343
41343
  });
41344
41344
  }
41345
41345
  }
41346
- async sendHtmlEmail(input) {
41346
+ async sendHtmlEmail(input, options) {
41347
41347
  const request = removeUndefinedProps({
41348
41348
  from: input.from ?? sendgridSettings.value.defaultSender,
41349
41349
  to: sanitizeArray(input.to),
@@ -41367,6 +41367,31 @@ let SendgridEmailProvider = class SendgridEmailProvider {
41367
41367
  ? attachment.content.toString("base64")
41368
41368
  : attachment.content,
41369
41369
  })),
41370
+ mailSettings: {
41371
+ ...(options?.sandboxMode || sendgridSettings.value.sandboxMode
41372
+ ? {
41373
+ sandboxMode: {
41374
+ enable: true,
41375
+ },
41376
+ }
41377
+ : {}),
41378
+ ...(options?.forceDelivery || sendgridSettings.value.forceDelivery
41379
+ ? {
41380
+ // bypassListManagement: {
41381
+ // enable: true,
41382
+ // },
41383
+ bypassBounceManagement: {
41384
+ enable: true,
41385
+ },
41386
+ // bypassUnsubscribeManagement: {
41387
+ // enable: true,
41388
+ // },
41389
+ // bypassSpamManagement: {
41390
+ // enable: true,
41391
+ // },
41392
+ }
41393
+ : {}),
41394
+ },
41370
41395
  });
41371
41396
  if (sendgridSettings.value.loggingEnabled) {
41372
41397
  this.logger.info("Sending html email", {