@travetto/email 4.1.0 → 5.0.0-rc.0

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": "4.1.0",
3
+ "version": "5.0.0-rc.0",
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/base": "^4.1.0",
27
- "@travetto/config": "^4.1.0",
28
- "@travetto/di": "^4.1.0",
26
+ "@travetto/base": "^5.0.0-rc.0",
27
+ "@travetto/config": "^5.0.0-rc.0",
28
+ "@travetto/di": "^5.0.0-rc.0",
29
29
  "@types/mustache": "^4.2.5",
30
30
  "mustache": "^4.2.0"
31
31
  },
package/src/template.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { render } from 'mustache';
1
+ import mustache from 'mustache';
2
2
 
3
3
  import { Injectable } from '@travetto/di';
4
4
  import { RuntimeResources } from '@travetto/base';
@@ -43,6 +43,6 @@ export class MustacheInterpolator implements MailInterpolator {
43
43
  * Interpolate text with data
44
44
  */
45
45
  render(text: string, data: Record<string, unknown>): string {
46
- return render(text, data);
46
+ return mustache.render(text, data);
47
47
  }
48
48
  }
package/src/util.ts CHANGED
@@ -78,7 +78,7 @@ export class MailUtil {
78
78
  static buildUniqueMessageId(message: EmailOptions): string {
79
79
  const from = this.getPrimaryEmail(message.from)!;
80
80
  const to = this.getPrimaryEmail(message.to)!;
81
- const uid = Util.shortHash(`${to}${from}${message.subject}${Date.now()}`).substring(0, 12);
81
+ const uid = Util.hash(`${to}${from}${message.subject}${Date.now()}`, 12);
82
82
  return `<${uid}@${from.split('@')[1]}>`;
83
83
  }
84
84
  }