@live-change/email-service 0.9.31 → 0.9.32
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/index.js +1 -0
- package/notiifcations.js +50 -0
- package/package.json +3 -3
package/index.js
CHANGED
package/notiifcations.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import App from '@live-change/framework'
|
|
2
|
+
const app = App.app()
|
|
3
|
+
import definition from './definition.js'
|
|
4
|
+
|
|
5
|
+
definition.trigger({
|
|
6
|
+
name: 'notificationCreated',
|
|
7
|
+
properties: {
|
|
8
|
+
notification: {
|
|
9
|
+
type: Object
|
|
10
|
+
},
|
|
11
|
+
sessionOrUserType: {
|
|
12
|
+
type: String,
|
|
13
|
+
validation: ['nonEmpty']
|
|
14
|
+
},
|
|
15
|
+
sessionOrUser: {
|
|
16
|
+
type: String,
|
|
17
|
+
validation: ['nonEmpty']
|
|
18
|
+
},
|
|
19
|
+
notificationType: {
|
|
20
|
+
type: String,
|
|
21
|
+
validation: ['nonEmpty']
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
async execute(params , { service }, emit) {
|
|
25
|
+
/// TODO: think if this mechanism along with grouping could be moved to notification service
|
|
26
|
+
/// TODO: check if user enabled email for this type of notification
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
definition.trigger({
|
|
31
|
+
name: 'checkEmailNotificationState',
|
|
32
|
+
properties: {
|
|
33
|
+
sessionOrUserType: {
|
|
34
|
+
type: String,
|
|
35
|
+
validation: ['nonEmpty']
|
|
36
|
+
},
|
|
37
|
+
sessionOrUser: {
|
|
38
|
+
type: String,
|
|
39
|
+
validation: ['nonEmpty']
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
async execute(params , { service }, emit) {
|
|
43
|
+
|
|
44
|
+
/// TODO: 1. get notifications by user
|
|
45
|
+
/// TODO: 2. check if there are any notifications that are not emailed yed
|
|
46
|
+
/// TODO: 3. decide if notifications should be grouped, partition notifications to grouped and non-grouped
|
|
47
|
+
/// TODO: 4. send email for each group of notifications, and each non-grouped notification
|
|
48
|
+
/// TODO: 5. mark notifications as emailed
|
|
49
|
+
}
|
|
50
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/email-service",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "^0.9.
|
|
24
|
+
"@live-change/framework": "^0.9.32",
|
|
25
25
|
"got": "^11.8.6",
|
|
26
26
|
"html-to-text": "8.1.0",
|
|
27
27
|
"inline-css": "4.0.2",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"juice": "11.0.0",
|
|
30
30
|
"nodemailer": "^6.7.2"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "41022fc283020e2da3e82aa27274401052d2379a",
|
|
33
33
|
"type": "module"
|
|
34
34
|
}
|