@bymax-one/nest-notification 1.4.5 → 1.4.6

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.6] - 2026-11-01
11
+
12
+ ### Fixed
13
+
14
+ - **The missing-template startup warning names the locale once for an `en` host.** With `en` as the
15
+ default locale the line read "neither 'en' nor 'en'". It now reads "does not resolve for 'en'";
16
+ every other default locale keeps "resolves for neither '<locale>' nor 'en'".
17
+ - **The `remedy` on `TEMPLATE_NOT_FOUND` for `otp_code` is true on every path.** It told the reader
18
+ to pass `emailTemplate` to `generate()`, which a direct `sendTemplate('otp_code')` has no way to
19
+ do. It now says where the option applies: the OTP email can use another template through the
20
+ `emailTemplate` option of `generate()`.
21
+
10
22
  ## [1.4.5] - 2026-11-01
11
23
 
12
24
  ### Added
@@ -1003,7 +1015,8 @@ rejected at startup rather than failing on the first send.
1003
1015
 
1004
1016
  [1.0.4]: https://github.com/bymaxone/nest-notification/compare/v1.0.3...v1.0.4
1005
1017
  [1.0.3]: https://github.com/bymaxone/nest-notification/compare/v1.0.2...v1.0.3
1006
- [Unreleased]: https://github.com/bymaxone/nest-notification/compare/v1.4.5...HEAD
1018
+ [Unreleased]: https://github.com/bymaxone/nest-notification/compare/v1.4.6...HEAD
1019
+ [1.4.6]: https://github.com/bymaxone/nest-notification/compare/v1.4.5...v1.4.6
1007
1020
  [1.4.5]: https://github.com/bymaxone/nest-notification/compare/v1.4.4...v1.4.5
1008
1021
  [1.4.4]: https://github.com/bymaxone/nest-notification/compare/v1.4.3...v1.4.4
1009
1022
  [1.4.3]: https://github.com/bymaxone/nest-notification/compare/v1.4.2...v1.4.3
@@ -934,7 +934,7 @@ function assertIdentifies(owner, label, value) {
934
934
 
935
935
  // src/server/services/email.service.ts
936
936
  var FALLBACK_LOCALE = "en";
937
- var OTP_TEMPLATE_REMEDY = "register an 'otp_code' template (for example 'otp_code::en') in your template renderer, such as DefaultTemplateRenderer, or pass emailTemplate to generate()";
937
+ var OTP_TEMPLATE_REMEDY = "register an 'otp_code' template (for example 'otp_code::en') in your template renderer, such as DefaultTemplateRenderer; the OTP email can use another template through the emailTemplate option of generate()";
938
938
  var WITHHELD_PROVIDER_TEXT = "[provider text withheld]";
939
939
  function readAttachedStatus(error) {
940
940
  try {
@@ -1607,8 +1607,9 @@ exports.OtpService = class OtpService {
1607
1607
  if (!this.emailService.isConfigured() || await this.emailService.resolvesTemplate(DEFAULT_OTP_TEMPLATE, locale)) {
1608
1608
  return;
1609
1609
  }
1610
+ const resolution = locale === "en" ? "does not resolve for 'en'" : `resolves for neither '${locale}' nor 'en'`;
1610
1611
  this.logger.warn(
1611
- `[${TEMPLATE_WARNING_CODE}] The email template '${DEFAULT_OTP_TEMPLATE}' resolves for neither '${locale}' nor 'en', so the first generate() that delivers by email fails with TEMPLATE_NOT_FOUND. Register '${DEFAULT_OTP_TEMPLATE}' in your template renderer (DefaultTemplateRenderer takes it under 'otp_code::en'). Ignore this line if every generate() call passes emailTemplate, if you deliver manually, or if your renderer loads its templates after startup.`
1612
+ `[${TEMPLATE_WARNING_CODE}] The email template '${DEFAULT_OTP_TEMPLATE}' ${resolution}, so the first generate() that delivers by email fails with TEMPLATE_NOT_FOUND. Register '${DEFAULT_OTP_TEMPLATE}' in your template renderer (DefaultTemplateRenderer takes it under 'otp_code::en'). Ignore this line if every generate() call passes emailTemplate, if you deliver manually, or if your renderer loads its templates after startup.`
1612
1613
  );
1613
1614
  } catch (error) {
1614
1615
  this.logger.warn(
@@ -932,7 +932,7 @@ function assertIdentifies(owner, label, value) {
932
932
 
933
933
  // src/server/services/email.service.ts
934
934
  var FALLBACK_LOCALE = "en";
935
- var OTP_TEMPLATE_REMEDY = "register an 'otp_code' template (for example 'otp_code::en') in your template renderer, such as DefaultTemplateRenderer, or pass emailTemplate to generate()";
935
+ var OTP_TEMPLATE_REMEDY = "register an 'otp_code' template (for example 'otp_code::en') in your template renderer, such as DefaultTemplateRenderer; the OTP email can use another template through the emailTemplate option of generate()";
936
936
  var WITHHELD_PROVIDER_TEXT = "[provider text withheld]";
937
937
  function readAttachedStatus(error) {
938
938
  try {
@@ -1605,8 +1605,9 @@ var OtpService = class {
1605
1605
  if (!this.emailService.isConfigured() || await this.emailService.resolvesTemplate(DEFAULT_OTP_TEMPLATE, locale)) {
1606
1606
  return;
1607
1607
  }
1608
+ const resolution = locale === "en" ? "does not resolve for 'en'" : `resolves for neither '${locale}' nor 'en'`;
1608
1609
  this.logger.warn(
1609
- `[${TEMPLATE_WARNING_CODE}] The email template '${DEFAULT_OTP_TEMPLATE}' resolves for neither '${locale}' nor 'en', so the first generate() that delivers by email fails with TEMPLATE_NOT_FOUND. Register '${DEFAULT_OTP_TEMPLATE}' in your template renderer (DefaultTemplateRenderer takes it under 'otp_code::en'). Ignore this line if every generate() call passes emailTemplate, if you deliver manually, or if your renderer loads its templates after startup.`
1610
+ `[${TEMPLATE_WARNING_CODE}] The email template '${DEFAULT_OTP_TEMPLATE}' ${resolution}, so the first generate() that delivers by email fails with TEMPLATE_NOT_FOUND. Register '${DEFAULT_OTP_TEMPLATE}' in your template renderer (DefaultTemplateRenderer takes it under 'otp_code::en'). Ignore this line if every generate() call passes emailTemplate, if you deliver manually, or if your renderer loads its templates after startup.`
1610
1611
  );
1611
1612
  } catch (error) {
1612
1613
  this.logger.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymax-one/nest-notification",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Multi-channel notification library for NestJS — email, OTP, SMS, push — with pluggable providers and storage, multi-tenant by design, zero runtime dependencies.",
5
5
  "author": "Bymax One <support@bymax.one>",
6
6
  "license": "MIT",