@travetto/email 4.1.1 → 5.0.0-rc.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email",
3
- "version": "4.1.1",
3
+ "version": "5.0.0-rc.1",
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.1",
27
- "@travetto/config": "^4.1.1",
28
- "@travetto/di": "^4.1.1",
26
+ "@travetto/base": "^5.0.0-rc.1",
27
+ "@travetto/config": "^5.0.0-rc.1",
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
@@ -1,7 +1,6 @@
1
- import { RuntimeContext } from '@travetto/manifest';
1
+ import { Util, RuntimeContext } from '@travetto/base';
2
2
 
3
3
  import { EmailAttachment, EmailIdentity, EmailIdentityList, EmailOptions } from './types';
4
- import { Util } from '@travetto/base';
5
4
 
6
5
  /**
7
6
  * Utilities for email
@@ -78,7 +77,7 @@ export class MailUtil {
78
77
  static buildUniqueMessageId(message: EmailOptions): string {
79
78
  const from = this.getPrimaryEmail(message.from)!;
80
79
  const to = this.getPrimaryEmail(message.to)!;
81
- const uid = Util.shortHash(`${to}${from}${message.subject}${Date.now()}`).substring(0, 12);
80
+ const uid = Util.hash(`${to}${from}${message.subject}${Date.now()}`, 12);
82
81
  return `<${uid}@${from.split('@')[1]}>`;
83
82
  }
84
83
  }