@travetto/email 2.0.0 → 2.1.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 +7 -7
- package/src/service.ts +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email",
|
|
3
3
|
"displayName": "Email",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "Email transmission module.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"email",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"directory": "module/email"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/config": "^2.
|
|
28
|
-
"@travetto/di": "^2.
|
|
29
|
-
"@types/mustache": "^4.1.
|
|
27
|
+
"@travetto/config": "^2.1.0",
|
|
28
|
+
"@travetto/di": "^2.1.0",
|
|
29
|
+
"@types/mustache": "^4.1.2",
|
|
30
30
|
"mustache": "^4.2.0"
|
|
31
31
|
},
|
|
32
32
|
"optionalPeerDependencies": {
|
|
33
|
-
"nodemailer": "^6.
|
|
34
|
-
"@types/nodemailer": "^6.4.
|
|
33
|
+
"nodemailer": "^6.7.2",
|
|
34
|
+
"@types/nodemailer": "^6.4.4"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"docDependencies": {
|
|
40
|
-
"@aws-sdk/client-ses": "^3.
|
|
40
|
+
"@aws-sdk/client-ses": "^3.49.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/service.ts
CHANGED
|
@@ -45,7 +45,8 @@ export class MailService {
|
|
|
45
45
|
* Send a pre compiled email that has a relevant html, subject and optional text file associated
|
|
46
46
|
*/
|
|
47
47
|
async sendCompiled(key: string, msg: Omit<MessageOptions, 'html' | 'text' | 'subject'>): Promise<unknown> {
|
|
48
|
-
if
|
|
48
|
+
// Bypass cache if in dynamic mode
|
|
49
|
+
if (EnvUtil.isDynamic() || !this.#compiled.has(key)) {
|
|
49
50
|
const [html, text, subject] = await Promise.all([
|
|
50
51
|
ResourceManager.read(`${key}.compiled.html`, 'utf8'),
|
|
51
52
|
ResourceManager.read(`${key}.compiled.text`, 'utf8').catch(() => ''),
|