@punks/backend-entity-manager 0.0.478 → 0.0.480

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.
package/dist/cjs/index.js CHANGED
@@ -22809,11 +22809,15 @@ exports.EmailService = class EmailService {
22809
22809
  ...transformedInput,
22810
22810
  ...normalizeAddresses(transformedInput),
22811
22811
  };
22812
- await this.provider.sendTemplatedEmail(normalizedInput, template, options);
22812
+ if (this.hasRecipients(normalizedInput)) {
22813
+ await this.provider.sendTemplatedEmail(normalizedInput, template, options);
22814
+ }
22813
22815
  await this.logger.logTemplatedEmail(normalizedInput);
22814
22816
  }
22815
22817
  async sendHtmlEmail(input, options) {
22816
- await this.provider.sendHtmlEmail(input, options);
22818
+ if (this.hasRecipients(input)) {
22819
+ await this.provider.sendHtmlEmail(input, options);
22820
+ }
22817
22821
  await this.logger.logHtmlEmail(input);
22818
22822
  }
22819
22823
  getTemplate(templateId) {
@@ -22823,6 +22827,9 @@ exports.EmailService = class EmailService {
22823
22827
  }
22824
22828
  return template;
22825
22829
  }
22830
+ hasRecipients(input) {
22831
+ return input.to?.length || input.cc?.length || input.bcc?.length;
22832
+ }
22826
22833
  get templateMiddleware() {
22827
22834
  return this.registry
22828
22835
  .getContainer()