@heliyos/heliyos-api-core 1.0.60 → 1.0.62

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.
@@ -7,5 +7,6 @@ export declare const emailTemplates: {
7
7
  passwordResetSuccess: string;
8
8
  notificationImmediate: string;
9
9
  notificationDailySummary: string;
10
+ organizationDailySummary: string;
10
11
  };
11
12
  export declare const getEmailTemplate: (template: string, data: object) => string;
@@ -39,6 +39,7 @@ exports.emailTemplates = {
39
39
  passwordResetSuccess: "password-reset-success.html",
40
40
  notificationImmediate: "notification-immediate.html",
41
41
  notificationDailySummary: "notification-daily-summary.html",
42
+ organizationDailySummary: "organization-daily-summary.html",
42
43
  };
43
44
  const getEmailTemplate = (template, data) => {
44
45
  const filePath = path.join(__dirname, template);
@@ -245,7 +245,7 @@
245
245
  {{#if has_tasks}}
246
246
  <div class="section">
247
247
  <div class="section-header">
248
- <h2 class="section-title">✅ Tasks</h2>
248
+ <h2 class="section-title">✓ Tasks</h2>
249
249
  <span class="section-count">{{tasks_count}}</span>
250
250
  </div>
251
251
  <div class="section-content">
@@ -286,9 +286,6 @@
286
286
  </div>
287
287
  {{/each}}
288
288
  </div>
289
- <div class="view-all-link">
290
- <a href="{{tasks_url}}">View all tasks →</a>
291
- </div>
292
289
  </div>
293
290
  {{/if}}
294
291
 
@@ -336,16 +333,13 @@
336
333
  </div>
337
334
  {{/each}}
338
335
  </div>
339
- <div class="view-all-link">
340
- <a href="{{deals_url}}">View all deals →</a>
341
- </div>
342
336
  </div>
343
337
  {{/if}}
344
338
 
345
339
  {{#if has_approvals}}
346
340
  <div class="section">
347
341
  <div class="section-header">
348
- <h2 class="section-title">✔️ Approvals</h2>
342
+ <h2 class="section-title">✔️ Reviews</h2>
349
343
  <span class="section-count">{{approvals_count}}</span>
350
344
  </div>
351
345
  <div class="section-content">
@@ -386,16 +380,13 @@
386
380
  </div>
387
381
  {{/each}}
388
382
  </div>
389
- <div class="view-all-link">
390
- <a href="{{approvals_url}}">View all approvals →</a>
391
- </div>
392
383
  </div>
393
384
  {{/if}}
394
385
 
395
386
  {{#if has_leadsets}}
396
387
  <div class="section">
397
388
  <div class="section-header">
398
- <h2 class="section-title">📋 Leadsets</h2>
389
+ <h2 class="section-title">✨ Leadsets</h2>
399
390
  <span class="section-count">{{leadsets_count}}</span>
400
391
  </div>
401
392
  <div class="section-content">
@@ -433,9 +424,6 @@
433
424
  </div>
434
425
  {{/each}}
435
426
  </div>
436
- <div class="view-all-link">
437
- <a href="{{leadsets_url}}">View all leadsets →</a>
438
- </div>
439
427
  </div>
440
428
  {{/if}}
441
429
 
@@ -0,0 +1,229 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>{{organization_name}} Daily Briefing</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ line-height: 1.6;
12
+ color: #0e0d0c;
13
+ background-color: #f8f8f6;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ .container {
19
+ max-width: 600px;
20
+ margin: 20px auto;
21
+ background-color: #ffffff;
22
+ border: 2px solid #7c3aed;
23
+ border-radius: 12px;
24
+ overflow: hidden;
25
+ }
26
+
27
+ .header {
28
+ background-color: #7c3aed;
29
+ padding: 30px 20px;
30
+ text-align: center;
31
+ }
32
+
33
+ .header img {
34
+ max-width: 180px;
35
+ height: auto;
36
+ margin-bottom: 12px;
37
+ }
38
+
39
+ .header-title {
40
+ color: #ffffff;
41
+ font-size: 24px;
42
+ font-weight: bold;
43
+ margin: 10px 0 4px 0;
44
+ }
45
+
46
+ .header-date {
47
+ color: #ffffff;
48
+ opacity: 0.9;
49
+ font-size: 14px;
50
+ }
51
+
52
+ .badge {
53
+ display: inline-block;
54
+ padding: 6px 14px;
55
+ background-color: rgba(255, 255, 255, 0.2);
56
+ border-radius: 20px;
57
+ font-size: 13px;
58
+ color: #ffffff;
59
+ font-weight: 600;
60
+ margin-top: 10px;
61
+ }
62
+
63
+ .content {
64
+ padding: 30px;
65
+ background-color: #ffffff;
66
+ }
67
+
68
+ .greeting {
69
+ font-size: 16px;
70
+ color: #0e0d0c;
71
+ margin-bottom: 20px;
72
+ }
73
+
74
+ .section {
75
+ margin: 20px 0;
76
+ padding: 0;
77
+ background-color: transparent;
78
+ border-radius: 0;
79
+ border-left: none;
80
+ }
81
+
82
+ .section-header {
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ margin-bottom: 12px;
87
+ padding-bottom: 8px;
88
+ border-bottom: 1px solid #e5e7eb;
89
+ }
90
+
91
+ .section-title {
92
+ font-size: 16px;
93
+ font-weight: bold;
94
+ color: #111827;
95
+ margin: 0;
96
+ }
97
+
98
+ .summary-text {
99
+ font-size: 15px;
100
+ line-height: 1.7;
101
+ color: #374151;
102
+ padding: 16px;
103
+ background-color: #f9fafb;
104
+ border-radius: 8px;
105
+ border-left: 4px solid #7c3aed;
106
+ margin-bottom: 20px;
107
+ white-space: pre-wrap;
108
+ word-wrap: break-word;
109
+ }
110
+
111
+ .list-container {
112
+ background-color: #ffffff;
113
+ }
114
+
115
+ .list-item {
116
+ padding: 12px 0;
117
+ border-bottom: 1px solid #f3f4f6;
118
+ line-height: 1.6;
119
+ color: #374151;
120
+ font-size: 14px;
121
+ }
122
+
123
+ .list-item:last-child {
124
+ border-bottom: none;
125
+ }
126
+
127
+ .footer {
128
+ background-color: #7c3aed;
129
+ padding: 20px;
130
+ text-align: center;
131
+ font-size: 12px;
132
+ color: #ffffff;
133
+ }
134
+
135
+ .footer a {
136
+ color: #ffffff;
137
+ text-decoration: none;
138
+ }
139
+
140
+ .divider {
141
+ height: 1px;
142
+ background-color: #ebe7db;
143
+ margin: 24px 0;
144
+ }
145
+ </style>
146
+ </head>
147
+
148
+ <body>
149
+ <div class="container">
150
+ <div class="header">
151
+ <img src="https://assets.heliyos.ai/heliyos-logo-white.png" alt="Heliyos AI">
152
+ <div class="header-title">{{organization_name}} Daily Briefing</div>
153
+ <div class="header-date">{{date}}</div>
154
+ <div class="badge">📊 Organization summary</div>
155
+ </div>
156
+
157
+ <div class="content">
158
+ <div class="greeting">
159
+ Hello {{first_name}},<br>
160
+ Here's your comprehensive daily briefing for {{organization_name}}.
161
+ </div>
162
+
163
+ <!-- Summary Section -->
164
+ <div class="section">
165
+ <div class="section-header">
166
+ <h2 class="section-title">📊 Daily Overview</h2>
167
+ </div>
168
+ <div class="summary-text">{{summary}}</div>
169
+ </div>
170
+
171
+ <!-- Key Highlights -->
172
+ {{#if key_highlights}}
173
+ <div class="section">
174
+ <div class="section-header">
175
+ <h2 class="section-title">✨ Key Highlights</h2>
176
+ </div>
177
+ <div class="list-container">
178
+ {{#each key_highlights}}
179
+ <div class="list-item">{{this}}</div>
180
+ {{/each}}
181
+ </div>
182
+ </div>
183
+ {{/if}}
184
+
185
+ <!-- Action Items -->
186
+ {{#if action_items}}
187
+ <div class="section">
188
+ <div class="section-header">
189
+ <h2 class="section-title">✓ Action Items</h2>
190
+ </div>
191
+ <div class="list-container">
192
+ {{#each action_items}}
193
+ <div class="list-item">{{this}}</div>
194
+ {{/each}}
195
+ </div>
196
+ </div>
197
+ {{/if}}
198
+
199
+ <!-- Upcoming Priorities -->
200
+ {{#if upcoming_priorities}}
201
+ <div class="section">
202
+ <div class="section-header">
203
+ <h2 class="section-title">🎯 Upcoming Priorities</h2>
204
+ </div>
205
+ <div class="list-container">
206
+ {{#each upcoming_priorities}}
207
+ <div class="list-item">{{this}}</div>
208
+ {{/each}}
209
+ </div>
210
+ </div>
211
+ {{/if}}
212
+
213
+ <div class="divider"></div>
214
+
215
+ <p style="text-align: center; color: #5c5545; font-size: 14px;">
216
+ You received this email because you have daily organization summaries enabled.<br>
217
+ <a href="{{settings_url}}" style="color: #7c3aed;">Manage your notification preferences</a>
218
+ </p>
219
+ </div>
220
+ <div class="footer">
221
+ <p>© {{year}} {{company_name}}. All rights reserved.</p>
222
+ <p>
223
+ <a href="{{settings_url}}">Notification Settings</a> |
224
+ This is an automated message, please do not reply.
225
+ </p>
226
+ </div>
227
+ </div>
228
+ </body>
229
+ </html>
package/dist/resend.js CHANGED
@@ -51,6 +51,9 @@ const resendSendEmail = (to, templateId, dynamicTemplateData, subject) => __awai
51
51
  firstName = email.split("@")[0];
52
52
  }
53
53
  }
54
+ if (firstName) {
55
+ firstName = firstName.charAt(0).toUpperCase() + firstName.slice(1);
56
+ }
54
57
  const message = {
55
58
  to: [email],
56
59
  from,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heliyos/heliyos-api-core",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "description": "Heliyos's core api functions and middlewares. Its a private package hosted on npm.",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -11,6 +11,7 @@ export const emailTemplates = {
11
11
  passwordResetSuccess: "password-reset-success.html",
12
12
  notificationImmediate: "notification-immediate.html",
13
13
  notificationDailySummary: "notification-daily-summary.html",
14
+ organizationDailySummary: "organization-daily-summary.html",
14
15
  };
15
16
 
16
17
  export const getEmailTemplate = (template: string, data: object) => {
@@ -245,7 +245,7 @@
245
245
  {{#if has_tasks}}
246
246
  <div class="section">
247
247
  <div class="section-header">
248
- <h2 class="section-title">✅ Tasks</h2>
248
+ <h2 class="section-title">✓ Tasks</h2>
249
249
  <span class="section-count">{{tasks_count}}</span>
250
250
  </div>
251
251
  <div class="section-content">
@@ -286,9 +286,6 @@
286
286
  </div>
287
287
  {{/each}}
288
288
  </div>
289
- <div class="view-all-link">
290
- <a href="{{tasks_url}}">View all tasks →</a>
291
- </div>
292
289
  </div>
293
290
  {{/if}}
294
291
 
@@ -336,16 +333,13 @@
336
333
  </div>
337
334
  {{/each}}
338
335
  </div>
339
- <div class="view-all-link">
340
- <a href="{{deals_url}}">View all deals →</a>
341
- </div>
342
336
  </div>
343
337
  {{/if}}
344
338
 
345
339
  {{#if has_approvals}}
346
340
  <div class="section">
347
341
  <div class="section-header">
348
- <h2 class="section-title">✔️ Approvals</h2>
342
+ <h2 class="section-title">✔️ Reviews</h2>
349
343
  <span class="section-count">{{approvals_count}}</span>
350
344
  </div>
351
345
  <div class="section-content">
@@ -386,16 +380,13 @@
386
380
  </div>
387
381
  {{/each}}
388
382
  </div>
389
- <div class="view-all-link">
390
- <a href="{{approvals_url}}">View all approvals →</a>
391
- </div>
392
383
  </div>
393
384
  {{/if}}
394
385
 
395
386
  {{#if has_leadsets}}
396
387
  <div class="section">
397
388
  <div class="section-header">
398
- <h2 class="section-title">📋 Leadsets</h2>
389
+ <h2 class="section-title">✨ Leadsets</h2>
399
390
  <span class="section-count">{{leadsets_count}}</span>
400
391
  </div>
401
392
  <div class="section-content">
@@ -433,9 +424,6 @@
433
424
  </div>
434
425
  {{/each}}
435
426
  </div>
436
- <div class="view-all-link">
437
- <a href="{{leadsets_url}}">View all leadsets →</a>
438
- </div>
439
427
  </div>
440
428
  {{/if}}
441
429
 
@@ -0,0 +1,229 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>{{organization_name}} Daily Briefing</title>
8
+ <style>
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ line-height: 1.6;
12
+ color: #0e0d0c;
13
+ background-color: #f8f8f6;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ .container {
19
+ max-width: 600px;
20
+ margin: 20px auto;
21
+ background-color: #ffffff;
22
+ border: 2px solid #7c3aed;
23
+ border-radius: 12px;
24
+ overflow: hidden;
25
+ }
26
+
27
+ .header {
28
+ background-color: #7c3aed;
29
+ padding: 30px 20px;
30
+ text-align: center;
31
+ }
32
+
33
+ .header img {
34
+ max-width: 180px;
35
+ height: auto;
36
+ margin-bottom: 12px;
37
+ }
38
+
39
+ .header-title {
40
+ color: #ffffff;
41
+ font-size: 24px;
42
+ font-weight: bold;
43
+ margin: 10px 0 4px 0;
44
+ }
45
+
46
+ .header-date {
47
+ color: #ffffff;
48
+ opacity: 0.9;
49
+ font-size: 14px;
50
+ }
51
+
52
+ .badge {
53
+ display: inline-block;
54
+ padding: 6px 14px;
55
+ background-color: rgba(255, 255, 255, 0.2);
56
+ border-radius: 20px;
57
+ font-size: 13px;
58
+ color: #ffffff;
59
+ font-weight: 600;
60
+ margin-top: 10px;
61
+ }
62
+
63
+ .content {
64
+ padding: 30px;
65
+ background-color: #ffffff;
66
+ }
67
+
68
+ .greeting {
69
+ font-size: 16px;
70
+ color: #0e0d0c;
71
+ margin-bottom: 20px;
72
+ }
73
+
74
+ .section {
75
+ margin: 20px 0;
76
+ padding: 0;
77
+ background-color: transparent;
78
+ border-radius: 0;
79
+ border-left: none;
80
+ }
81
+
82
+ .section-header {
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ margin-bottom: 12px;
87
+ padding-bottom: 8px;
88
+ border-bottom: 1px solid #e5e7eb;
89
+ }
90
+
91
+ .section-title {
92
+ font-size: 16px;
93
+ font-weight: bold;
94
+ color: #111827;
95
+ margin: 0;
96
+ }
97
+
98
+ .summary-text {
99
+ font-size: 15px;
100
+ line-height: 1.7;
101
+ color: #374151;
102
+ padding: 16px;
103
+ background-color: #f9fafb;
104
+ border-radius: 8px;
105
+ border-left: 4px solid #7c3aed;
106
+ margin-bottom: 20px;
107
+ white-space: pre-wrap;
108
+ word-wrap: break-word;
109
+ }
110
+
111
+ .list-container {
112
+ background-color: #ffffff;
113
+ }
114
+
115
+ .list-item {
116
+ padding: 12px 0;
117
+ border-bottom: 1px solid #f3f4f6;
118
+ line-height: 1.6;
119
+ color: #374151;
120
+ font-size: 14px;
121
+ }
122
+
123
+ .list-item:last-child {
124
+ border-bottom: none;
125
+ }
126
+
127
+ .footer {
128
+ background-color: #7c3aed;
129
+ padding: 20px;
130
+ text-align: center;
131
+ font-size: 12px;
132
+ color: #ffffff;
133
+ }
134
+
135
+ .footer a {
136
+ color: #ffffff;
137
+ text-decoration: none;
138
+ }
139
+
140
+ .divider {
141
+ height: 1px;
142
+ background-color: #ebe7db;
143
+ margin: 24px 0;
144
+ }
145
+ </style>
146
+ </head>
147
+
148
+ <body>
149
+ <div class="container">
150
+ <div class="header">
151
+ <img src="https://assets.heliyos.ai/heliyos-logo-white.png" alt="Heliyos AI">
152
+ <div class="header-title">{{organization_name}} Daily Briefing</div>
153
+ <div class="header-date">{{date}}</div>
154
+ <div class="badge">📊 Organization summary</div>
155
+ </div>
156
+
157
+ <div class="content">
158
+ <div class="greeting">
159
+ Hello {{first_name}},<br>
160
+ Here's your comprehensive daily briefing for {{organization_name}}.
161
+ </div>
162
+
163
+ <!-- Summary Section -->
164
+ <div class="section">
165
+ <div class="section-header">
166
+ <h2 class="section-title">📊 Daily Overview</h2>
167
+ </div>
168
+ <div class="summary-text">{{summary}}</div>
169
+ </div>
170
+
171
+ <!-- Key Highlights -->
172
+ {{#if key_highlights}}
173
+ <div class="section">
174
+ <div class="section-header">
175
+ <h2 class="section-title">✨ Key Highlights</h2>
176
+ </div>
177
+ <div class="list-container">
178
+ {{#each key_highlights}}
179
+ <div class="list-item">{{this}}</div>
180
+ {{/each}}
181
+ </div>
182
+ </div>
183
+ {{/if}}
184
+
185
+ <!-- Action Items -->
186
+ {{#if action_items}}
187
+ <div class="section">
188
+ <div class="section-header">
189
+ <h2 class="section-title">✓ Action Items</h2>
190
+ </div>
191
+ <div class="list-container">
192
+ {{#each action_items}}
193
+ <div class="list-item">{{this}}</div>
194
+ {{/each}}
195
+ </div>
196
+ </div>
197
+ {{/if}}
198
+
199
+ <!-- Upcoming Priorities -->
200
+ {{#if upcoming_priorities}}
201
+ <div class="section">
202
+ <div class="section-header">
203
+ <h2 class="section-title">🎯 Upcoming Priorities</h2>
204
+ </div>
205
+ <div class="list-container">
206
+ {{#each upcoming_priorities}}
207
+ <div class="list-item">{{this}}</div>
208
+ {{/each}}
209
+ </div>
210
+ </div>
211
+ {{/if}}
212
+
213
+ <div class="divider"></div>
214
+
215
+ <p style="text-align: center; color: #5c5545; font-size: 14px;">
216
+ You received this email because you have daily organization summaries enabled.<br>
217
+ <a href="{{settings_url}}" style="color: #7c3aed;">Manage your notification preferences</a>
218
+ </p>
219
+ </div>
220
+ <div class="footer">
221
+ <p>© {{year}} {{company_name}}. All rights reserved.</p>
222
+ <p>
223
+ <a href="{{settings_url}}">Notification Settings</a> |
224
+ This is an automated message, please do not reply.
225
+ </p>
226
+ </div>
227
+ </div>
228
+ </body>
229
+ </html>