strapi-plugin-magic-mail 2.3.4 → 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 +12 -4
- package/dist/server/index.mjs +12 -4
- 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,15 +5975,23 @@ function requireEmailDesigner() {
|
|
|
5975
5975
|
});
|
|
5976
5976
|
},
|
|
5977
5977
|
/**
|
|
5978
|
-
* Get template by numeric
|
|
5978
|
+
* Get template by numeric templateReferenceId
|
|
5979
|
+
* The templateReferenceId is a unique integer field used to identify templates
|
|
5979
5980
|
*/
|
|
5980
5981
|
async findById(id) {
|
|
5982
|
+
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by templateReferenceId: ${id}`);
|
|
5981
5983
|
const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
|
|
5982
|
-
filters: { id },
|
|
5984
|
+
filters: { templateReferenceId: Number(id) },
|
|
5983
5985
|
limit: 1,
|
|
5984
5986
|
populate: ["versions"]
|
|
5985
5987
|
});
|
|
5986
|
-
|
|
5988
|
+
const result = results.length > 0 ? results[0] : null;
|
|
5989
|
+
if (result) {
|
|
5990
|
+
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by templateReferenceId ${id}: documentId=${result.documentId}, name="${result.name}"`);
|
|
5991
|
+
} else {
|
|
5992
|
+
strapi2.log.warn(`[magic-mail] [WARNING] Template with templateReferenceId ${id} not found`);
|
|
5993
|
+
}
|
|
5994
|
+
return result;
|
|
5987
5995
|
},
|
|
5988
5996
|
/**
|
|
5989
5997
|
* Get template by reference ID
|
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,15 +5965,23 @@ function requireEmailDesigner() {
|
|
|
5965
5965
|
});
|
|
5966
5966
|
},
|
|
5967
5967
|
/**
|
|
5968
|
-
* Get template by numeric
|
|
5968
|
+
* Get template by numeric templateReferenceId
|
|
5969
|
+
* The templateReferenceId is a unique integer field used to identify templates
|
|
5969
5970
|
*/
|
|
5970
5971
|
async findById(id) {
|
|
5972
|
+
strapi2.log.info(`[magic-mail] [LOOKUP] Finding template by templateReferenceId: ${id}`);
|
|
5971
5973
|
const results = await strapi2.documents(EMAIL_TEMPLATE_UID).findMany({
|
|
5972
|
-
filters: { id },
|
|
5974
|
+
filters: { templateReferenceId: Number(id) },
|
|
5973
5975
|
limit: 1,
|
|
5974
5976
|
populate: ["versions"]
|
|
5975
5977
|
});
|
|
5976
|
-
|
|
5978
|
+
const result = results.length > 0 ? results[0] : null;
|
|
5979
|
+
if (result) {
|
|
5980
|
+
strapi2.log.info(`[magic-mail] [SUCCESS] Found template by templateReferenceId ${id}: documentId=${result.documentId}, name="${result.name}"`);
|
|
5981
|
+
} else {
|
|
5982
|
+
strapi2.log.warn(`[magic-mail] [WARNING] Template with templateReferenceId ${id} not found`);
|
|
5983
|
+
}
|
|
5984
|
+
return result;
|
|
5977
5985
|
},
|
|
5978
5986
|
/**
|
|
5979
5987
|
* Get template by reference ID
|
package/package.json
CHANGED