strapi-plugin-magic-mail 2.3.5 → 2.3.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/dist/server/index.js +10 -8
- package/dist/server/index.mjs +10 -8
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -5543,7 +5543,7 @@ function requireOauth() {
|
|
|
5543
5543
|
});
|
|
5544
5544
|
return oauth;
|
|
5545
5545
|
}
|
|
5546
|
-
const version = "2.3.
|
|
5546
|
+
const version = "2.3.5";
|
|
5547
5547
|
const require$$2 = {
|
|
5548
5548
|
version
|
|
5549
5549
|
};
|
|
@@ -5975,19 +5975,21 @@ function requireEmailDesigner() {
|
|
|
5975
5975
|
});
|
|
5976
5976
|
},
|
|
5977
5977
|
/**
|
|
5978
|
-
* Get template by numeric
|
|
5979
|
-
*
|
|
5980
|
-
* so we use entityService as fallback for numeric IDs
|
|
5978
|
+
* Get template by numeric templateReferenceId
|
|
5979
|
+
* The templateReferenceId is a unique integer field used to identify templates
|
|
5981
5980
|
*/
|
|
5982
5981
|
async findById(id) {
|
|
5983
|
-
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by
|
|
5984
|
-
const
|
|
5982
|
+
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by templateReferenceId: ${id}`);
|
|
5983
|
+
const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
|
|
5984
|
+
filters: { templateReferenceId: Number(id) },
|
|
5985
|
+
limit: 1,
|
|
5985
5986
|
populate: ["versions"]
|
|
5986
5987
|
});
|
|
5988
|
+
const result = results.length > 0 ? results[0] : null;
|
|
5987
5989
|
if (result) {
|
|
5988
|
-
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by
|
|
5990
|
+
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by templateReferenceId ${id}: documentId=${result.documentId}, name="${result.name}"`);
|
|
5989
5991
|
} else {
|
|
5990
|
-
strapi2.log.warn(`[magic-mail] [WARNING] Template with
|
|
5992
|
+
strapi2.log.warn(`[magic-mail] [WARNING] Template with templateReferenceId ${id} not found`);
|
|
5991
5993
|
}
|
|
5992
5994
|
return result;
|
|
5993
5995
|
},
|
package/dist/server/index.mjs
CHANGED
|
@@ -5533,7 +5533,7 @@ function requireOauth() {
|
|
|
5533
5533
|
});
|
|
5534
5534
|
return oauth;
|
|
5535
5535
|
}
|
|
5536
|
-
const version = "2.3.
|
|
5536
|
+
const version = "2.3.5";
|
|
5537
5537
|
const require$$2 = {
|
|
5538
5538
|
version
|
|
5539
5539
|
};
|
|
@@ -5965,19 +5965,21 @@ function requireEmailDesigner() {
|
|
|
5965
5965
|
});
|
|
5966
5966
|
},
|
|
5967
5967
|
/**
|
|
5968
|
-
* Get template by numeric
|
|
5969
|
-
*
|
|
5970
|
-
* so we use entityService as fallback for numeric IDs
|
|
5968
|
+
* Get template by numeric templateReferenceId
|
|
5969
|
+
* The templateReferenceId is a unique integer field used to identify templates
|
|
5971
5970
|
*/
|
|
5972
5971
|
async findById(id) {
|
|
5973
|
-
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by
|
|
5974
|
-
const
|
|
5972
|
+
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by templateReferenceId: ${id}`);
|
|
5973
|
+
const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
|
|
5974
|
+
filters: { templateReferenceId: Number(id) },
|
|
5975
|
+
limit: 1,
|
|
5975
5976
|
populate: ["versions"]
|
|
5976
5977
|
});
|
|
5978
|
+
const result = results.length > 0 ? results[0] : null;
|
|
5977
5979
|
if (result) {
|
|
5978
|
-
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by
|
|
5980
|
+
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by templateReferenceId ${id}: documentId=${result.documentId}, name="${result.name}"`);
|
|
5979
5981
|
} else {
|
|
5980
|
-
strapi2.log.warn(`[magic-mail] [WARNING] Template with
|
|
5982
|
+
strapi2.log.warn(`[magic-mail] [WARNING] Template with templateReferenceId ${id} not found`);
|
|
5981
5983
|
}
|
|
5982
5984
|
return result;
|
|
5983
5985
|
},
|
package/package.json
CHANGED