strapi-plugin-magic-mail 2.3.4 → 2.3.5

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.
@@ -5543,7 +5543,7 @@ function requireOauth() {
5543
5543
  });
5544
5544
  return oauth;
5545
5545
  }
5546
- const version = "2.3.3";
5546
+ const version = "2.3.4";
5547
5547
  const require$$2 = {
5548
5548
  version
5549
5549
  };
@@ -5976,14 +5976,20 @@ function requireEmailDesigner() {
5976
5976
  },
5977
5977
  /**
5978
5978
  * Get template by numeric ID (for backward compatibility)
5979
+ * Note: Document Service cannot filter by internal 'id' field,
5980
+ * so we use entityService as fallback for numeric IDs
5979
5981
  */
5980
5982
  async findById(id) {
5981
- const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
5982
- filters: { id },
5983
- limit: 1,
5983
+ strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by numeric ID: ${id}`);
5984
+ const result = await strapi2.entityService.findOne(EMAIL_TEMPLATE_UID, id, {
5984
5985
  populate: ["versions"]
5985
5986
  });
5986
- return results.length > 0 ? results[0] : null;
5987
+ if (result) {
5988
+ strapi2.log.info(`[magic-mail] [SUCCESS] Found template by ID ${id}: documentId=${result.documentId}, name="${result.name}"`);
5989
+ } else {
5990
+ strapi2.log.warn(`[magic-mail] [WARNING] Template with ID ${id} not found`);
5991
+ }
5992
+ return result;
5987
5993
  },
5988
5994
  /**
5989
5995
  * Get template by reference ID
@@ -5533,7 +5533,7 @@ function requireOauth() {
5533
5533
  });
5534
5534
  return oauth;
5535
5535
  }
5536
- const version = "2.3.3";
5536
+ const version = "2.3.4";
5537
5537
  const require$$2 = {
5538
5538
  version
5539
5539
  };
@@ -5966,14 +5966,20 @@ function requireEmailDesigner() {
5966
5966
  },
5967
5967
  /**
5968
5968
  * Get template by numeric ID (for backward compatibility)
5969
+ * Note: Document Service cannot filter by internal 'id' field,
5970
+ * so we use entityService as fallback for numeric IDs
5969
5971
  */
5970
5972
  async findById(id) {
5971
- const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
5972
- filters: { id },
5973
- limit: 1,
5973
+ strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by numeric ID: ${id}`);
5974
+ const result = await strapi2.entityService.findOne(EMAIL_TEMPLATE_UID, id, {
5974
5975
  populate: ["versions"]
5975
5976
  });
5976
- return results.length > 0 ? results[0] : null;
5977
+ if (result) {
5978
+ strapi2.log.info(`[magic-mail] [SUCCESS] Found template by ID ${id}: documentId=${result.documentId}, name="${result.name}"`);
5979
+ } else {
5980
+ strapi2.log.warn(`[magic-mail] [WARNING] Template with ID ${id} not found`);
5981
+ }
5982
+ return result;
5977
5983
  },
5978
5984
  /**
5979
5985
  * Get template by reference ID
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.3.4",
2
+ "version": "2.3.5",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "strapi-plugin",