medusa-plugin-ses 2.0.0 → 2.0.2
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/README.md +1 -1
- package/package.json +1 -1
- package/services/ses.js +2 -2
- package/src/services/ses.js +2 -3
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ SES_TEMPLATE_PATH="/full/absolute/path/to/medusa-server/data/templates"
|
|
|
56
56
|
|
|
57
57
|
- The SES_FROM email address must be a verified sender in your AWS account.
|
|
58
58
|
|
|
59
|
-
- The template path
|
|
59
|
+
- The template path must be the full absolute path to the folder. For example, if your build runs from /home/medusa/medusa-server/, create a 'data/templates' folder and include the entire path in the SES_TEMPLATE_PATH variable.
|
|
60
60
|
```
|
|
61
61
|
medusa-server // root directory
|
|
62
62
|
|-data
|
package/package.json
CHANGED
package/services/ses.js
CHANGED
|
@@ -295,8 +295,8 @@ var SESService = /*#__PURE__*/function (_NotificationService) {
|
|
|
295
295
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
296
296
|
while (1) switch (_context3.prev = _context3.next) {
|
|
297
297
|
case 0:
|
|
298
|
-
base =
|
|
299
|
-
|
|
298
|
+
//const base = path.resolve(__dirname, '../../../', this.options_.template_path, templateId)
|
|
299
|
+
base = _path["default"].resolve(this.options_.template_path, templateId);
|
|
300
300
|
subjectTemplate = _handlebars["default"].compile(_fs["default"].readFileSync(_path["default"].join(base, 'subject.hbs'), "utf8"));
|
|
301
301
|
htmlTemplate = _handlebars["default"].compile(_fs["default"].readFileSync(_path["default"].join(base, 'html.hbs'), "utf8"));
|
|
302
302
|
textTemplate = _handlebars["default"].compile(_fs["default"].readFileSync(_path["default"].join(base, 'text.hbs'), "utf8"));
|
package/src/services/ses.js
CHANGED
|
@@ -227,9 +227,8 @@ class SESService extends NotificationService {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
async compileTemplate(templateId, data) {
|
|
230
|
-
const base = path.resolve(__dirname, '
|
|
231
|
-
|
|
232
|
-
//const base = path.resolve(this.options_.template_path, templateId)
|
|
230
|
+
//const base = path.resolve(__dirname, '../../../', this.options_.template_path, templateId)
|
|
231
|
+
const base = path.resolve(this.options_.template_path, templateId)
|
|
233
232
|
const subjectTemplate = Handlebars.compile(fs.readFileSync(path.join(base, 'subject.hbs'), "utf8"))
|
|
234
233
|
const htmlTemplate = Handlebars.compile(fs.readFileSync(path.join(base, 'html.hbs'), "utf8"))
|
|
235
234
|
const textTemplate = Handlebars.compile(fs.readFileSync(path.join(base, 'text.hbs'), "utf8"))
|