@travetto/email 8.0.0-alpha.0 → 8.0.0-alpha.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email",
3
- "version": "8.0.0-alpha.0",
3
+ "version": "8.0.0-alpha.10",
4
4
  "description": "Email transmission module.",
5
5
  "keywords": [
6
6
  "email",
@@ -23,9 +23,9 @@
23
23
  "directory": "module/email"
24
24
  },
25
25
  "dependencies": {
26
- "@travetto/config": "^8.0.0-alpha.0",
27
- "@travetto/di": "^8.0.0-alpha.0",
28
- "@travetto/runtime": "^8.0.0-alpha.0",
26
+ "@travetto/config": "^8.0.0-alpha.10",
27
+ "@travetto/di": "^8.0.0-alpha.10",
28
+ "@travetto/runtime": "^8.0.0-alpha.10",
29
29
  "@types/mustache": "^4.2.6",
30
30
  "mustache": "^4.2.0"
31
31
  },
package/src/service.ts CHANGED
@@ -37,9 +37,9 @@ export class MailService {
37
37
  async getCompiled(key: string): Promise<EmailCompiled> {
38
38
  if (!this.#compiled.has(key)) {
39
39
  const [html, text, subject] = await Promise.all([
40
- RuntimeResources.readText(`${key}.compiled.html`),
41
- RuntimeResources.readText(`${key}.compiled.text`),
42
- RuntimeResources.readText(`${key}.compiled.subject`)
40
+ RuntimeResources.readUTF8(`${key}.compiled.html`),
41
+ RuntimeResources.readUTF8(`${key}.compiled.text`),
42
+ RuntimeResources.readUTF8(`${key}.compiled.subject`)
43
43
  ].map(file => file.then(MailUtil.purgeBrand)));
44
44
  if (this.#cacheResults) {
45
45
  this.#compiled.set(key, { html, text, subject });
package/src/template.ts CHANGED
@@ -30,7 +30,7 @@ export class MustacheInterpolator implements MailInterpolator {
30
30
  const promises: Promise<string>[] = [];
31
31
  template = template.replace(/[{]{2,3}>\s+(\S+)([.]html)?\s*[}]{2,3}/g, (all: string, name: string) => {
32
32
  promises.push(
33
- RuntimeResources.readText(`${name}.html`) // Ensure html file
33
+ RuntimeResources.readUTF8(`${name}.html`) // Ensure html file
34
34
  .then(contents => this.resolveNested(contents))
35
35
  );
36
36
  return `$%${promises.length - 1}%$`;