hazo_notify 1.0.1 → 1.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/README.md +1 -5
- package/data/templates/email_signature.html +11 -0
- package/data/templates/email_signature.txt +4 -0
- package/data/templates/email_verification.html +64 -0
- package/data/templates/email_verification.txt +11 -0
- package/data/templates/forgot_password.html +64 -0
- package/data/templates/forgot_password.txt +11 -0
- package/data/templates/manifest.json +86 -0
- package/data/templates/welcome_email.html +54 -0
- package/data/templates/welcome_email.txt +8 -0
- package/dist/{lib/emailer → emailer}/emailer.d.ts +2 -2
- package/dist/emailer/emailer.d.ts.map +1 -0
- package/dist/{lib/emailer → emailer}/emailer.js +38 -24
- package/dist/emailer/emailer.js.map +1 -0
- package/dist/{lib/emailer → emailer}/index.d.ts +1 -0
- package/dist/emailer/index.d.ts.map +1 -0
- package/dist/{lib/emailer → emailer}/index.js +5 -1
- package/dist/emailer/index.js.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/index.d.ts +1 -1
- package/dist/emailer/providers/index.d.ts.map +1 -0
- package/dist/emailer/providers/index.js.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/pop3_provider.d.ts +3 -2
- package/dist/emailer/providers/pop3_provider.d.ts.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/pop3_provider.js +2 -1
- package/dist/emailer/providers/pop3_provider.js.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/smtp_provider.d.ts +3 -2
- package/dist/emailer/providers/smtp_provider.d.ts.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/smtp_provider.js +2 -1
- package/dist/emailer/providers/smtp_provider.js.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/zeptomail_provider.d.ts +3 -2
- package/dist/emailer/providers/zeptomail_provider.d.ts.map +1 -0
- package/dist/{lib/emailer → emailer}/providers/zeptomail_provider.js +56 -38
- package/dist/emailer/providers/zeptomail_provider.js.map +1 -0
- package/dist/{lib/emailer → emailer}/types.d.ts +13 -1
- package/dist/emailer/types.d.ts.map +1 -0
- package/dist/emailer/types.js.map +1 -0
- package/dist/{lib/emailer → emailer}/utils/constants.d.ts +1 -0
- package/dist/emailer/utils/constants.d.ts.map +1 -0
- package/dist/emailer/utils/constants.js.map +1 -0
- package/dist/emailer/utils/index.d.ts.map +1 -0
- package/dist/emailer/utils/index.js.map +1 -0
- package/dist/emailer/utils/logger.d.ts +48 -0
- package/dist/emailer/utils/logger.d.ts.map +1 -0
- package/dist/emailer/utils/logger.js +98 -0
- package/dist/emailer/utils/logger.js.map +1 -0
- package/dist/emailer/utils/validation.d.ts.map +1 -0
- package/dist/emailer/utils/validation.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{lib/index.js → index.js} +2 -1
- package/dist/index.js.map +1 -0
- package/dist/template_manager/config/config_loader.d.ts +48 -0
- package/dist/template_manager/config/config_loader.d.ts.map +1 -0
- package/dist/template_manager/config/config_loader.js +161 -0
- package/dist/template_manager/config/config_loader.js.map +1 -0
- package/dist/template_manager/config/constants.d.ts +101 -0
- package/dist/template_manager/config/constants.d.ts.map +1 -0
- package/dist/template_manager/config/constants.js +163 -0
- package/dist/template_manager/config/constants.js.map +1 -0
- package/dist/template_manager/config/index.d.ts +6 -0
- package/dist/template_manager/config/index.d.ts.map +1 -0
- package/dist/template_manager/config/index.js +24 -0
- package/dist/template_manager/config/index.js.map +1 -0
- package/dist/template_manager/db/category_repository.d.ts +57 -0
- package/dist/template_manager/db/category_repository.d.ts.map +1 -0
- package/dist/template_manager/db/category_repository.js +326 -0
- package/dist/template_manager/db/category_repository.js.map +1 -0
- package/dist/template_manager/db/index.d.ts +6 -0
- package/dist/template_manager/db/index.d.ts.map +1 -0
- package/dist/template_manager/db/index.js +23 -0
- package/dist/template_manager/db/index.js.map +1 -0
- package/dist/template_manager/db/template_repository.d.ts +76 -0
- package/dist/template_manager/db/template_repository.d.ts.map +1 -0
- package/dist/template_manager/db/template_repository.js +684 -0
- package/dist/template_manager/db/template_repository.js.map +1 -0
- package/dist/template_manager/engine/handlebars_engine.d.ts +52 -0
- package/dist/template_manager/engine/handlebars_engine.d.ts.map +1 -0
- package/dist/template_manager/engine/handlebars_engine.js +175 -0
- package/dist/template_manager/engine/handlebars_engine.js.map +1 -0
- package/dist/template_manager/engine/index.d.ts +6 -0
- package/dist/template_manager/engine/index.d.ts.map +1 -0
- package/dist/template_manager/engine/index.js +19 -0
- package/dist/template_manager/engine/index.js.map +1 -0
- package/dist/template_manager/engine/variable_resolver.d.ts +48 -0
- package/dist/template_manager/engine/variable_resolver.d.ts.map +1 -0
- package/dist/template_manager/engine/variable_resolver.js +223 -0
- package/dist/template_manager/engine/variable_resolver.js.map +1 -0
- package/dist/template_manager/index.d.ts +32 -0
- package/dist/template_manager/index.d.ts.map +1 -0
- package/dist/template_manager/index.js +88 -0
- package/dist/template_manager/index.js.map +1 -0
- package/dist/template_manager/template_manager.d.ts +69 -0
- package/dist/template_manager/template_manager.d.ts.map +1 -0
- package/dist/template_manager/template_manager.js +335 -0
- package/dist/template_manager/template_manager.js.map +1 -0
- package/dist/template_manager/types.d.ts +255 -0
- package/dist/template_manager/types.d.ts.map +1 -0
- package/dist/template_manager/types.js +12 -0
- package/dist/template_manager/types.js.map +1 -0
- package/dist/template_manager/utils/index.d.ts +6 -0
- package/dist/template_manager/utils/index.d.ts.map +1 -0
- package/dist/template_manager/utils/index.js +21 -0
- package/dist/template_manager/utils/index.js.map +1 -0
- package/dist/template_manager/utils/system_variables.d.ts +28 -0
- package/dist/template_manager/utils/system_variables.d.ts.map +1 -0
- package/dist/template_manager/utils/system_variables.js +209 -0
- package/dist/template_manager/utils/system_variables.js.map +1 -0
- package/dist/template_manager/utils/validation.d.ts +74 -0
- package/dist/template_manager/utils/validation.d.ts.map +1 -0
- package/dist/template_manager/utils/validation.js +163 -0
- package/dist/template_manager/utils/validation.js.map +1 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +18 -0
- package/dist/utils.js.map +1 -0
- package/hazo_notify_config.ini +39 -0
- package/package.json +71 -21
- package/dist/lib/emailer/emailer.d.ts.map +0 -1
- package/dist/lib/emailer/emailer.js.map +0 -1
- package/dist/lib/emailer/index.d.ts.map +0 -1
- package/dist/lib/emailer/index.js.map +0 -1
- package/dist/lib/emailer/providers/index.d.ts.map +0 -1
- package/dist/lib/emailer/providers/index.js.map +0 -1
- package/dist/lib/emailer/providers/pop3_provider.d.ts.map +0 -1
- package/dist/lib/emailer/providers/pop3_provider.js.map +0 -1
- package/dist/lib/emailer/providers/smtp_provider.d.ts.map +0 -1
- package/dist/lib/emailer/providers/smtp_provider.js.map +0 -1
- package/dist/lib/emailer/providers/zeptomail_provider.d.ts.map +0 -1
- package/dist/lib/emailer/providers/zeptomail_provider.js.map +0 -1
- package/dist/lib/emailer/types.d.ts.map +0 -1
- package/dist/lib/emailer/types.js.map +0 -1
- package/dist/lib/emailer/utils/constants.d.ts.map +0 -1
- package/dist/lib/emailer/utils/constants.js.map +0 -1
- package/dist/lib/emailer/utils/index.d.ts.map +0 -1
- package/dist/lib/emailer/utils/index.js.map +0 -1
- package/dist/lib/emailer/utils/logger.d.ts +0 -37
- package/dist/lib/emailer/utils/logger.d.ts.map +0 -1
- package/dist/lib/emailer/utils/logger.js +0 -60
- package/dist/lib/emailer/utils/logger.js.map +0 -1
- package/dist/lib/emailer/utils/validation.d.ts.map +0 -1
- package/dist/lib/emailer/utils/validation.js.map +0 -1
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- /package/dist/{lib/emailer → emailer}/providers/index.js +0 -0
- /package/dist/{lib/emailer → emailer}/types.js +0 -0
- /package/dist/{lib/emailer → emailer}/utils/constants.js +0 -0
- /package/dist/{lib/emailer → emailer}/utils/index.d.ts +0 -0
- /package/dist/{lib/emailer → emailer}/utils/index.js +0 -0
- /package/dist/{lib/emailer → emailer}/utils/validation.d.ts +0 -0
- /package/dist/{lib/emailer → emailer}/utils/validation.js +0 -0
package/README.md
CHANGED
|
@@ -19,11 +19,7 @@ A reusable component library for sending email notifications with support for mu
|
|
|
19
19
|
npm install hazo_notify
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install hazo_config
|
|
26
|
-
```
|
|
22
|
+
The package automatically installs required dependencies including `hazo_config` for configuration management and `isomorphic-dompurify` for HTML sanitization.
|
|
27
23
|
|
|
28
24
|
## Quick Start
|
|
29
25
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; margin-top: 24px; padding-top: 24px; border-top: 1px solid #e5e7eb;">
|
|
2
|
+
<table role="presentation" style="border-collapse: collapse;">
|
|
3
|
+
<tr>
|
|
4
|
+
<td style="padding: 0;">
|
|
5
|
+
<p style="margin: 0 0 4px 0; font-size: 16px; font-weight: 600; color: #1f2937;">{{sender_name}}</p>
|
|
6
|
+
<p style="margin: 0 0 4px 0; font-size: 14px; color: #6b7280;">{{sender_title}}</p>
|
|
7
|
+
<p style="margin: 0; font-size: 14px; color: #2563eb; font-weight: 500;">{{company_name}}</p>
|
|
8
|
+
</td>
|
|
9
|
+
</tr>
|
|
10
|
+
</table>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Verify Your Email</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f5f5f5;">
|
|
9
|
+
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
10
|
+
<tr>
|
|
11
|
+
<td style="padding: 40px 20px;">
|
|
12
|
+
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
|
|
13
|
+
<tr>
|
|
14
|
+
<td style="padding: 40px;">
|
|
15
|
+
<h1 style="color: #2563eb; margin: 0 0 20px 0; font-size: 28px; font-weight: 600;">Verify Your Email Address</h1>
|
|
16
|
+
|
|
17
|
+
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4b5563;">
|
|
18
|
+
Hi {{user_name}},
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4b5563;">
|
|
22
|
+
Please click the button below to verify your email address and complete your registration:
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<table role="presentation" style="margin: 0 0 24px 0;">
|
|
26
|
+
<tr>
|
|
27
|
+
<td style="background-color: #16a34a; border-radius: 6px;">
|
|
28
|
+
<a href="{{verification_link}}" style="display: inline-block; padding: 14px 28px; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: 500;">
|
|
29
|
+
Verify Email Address
|
|
30
|
+
</a>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</table>
|
|
34
|
+
|
|
35
|
+
<p style="margin: 0 0 16px 0; font-size: 14px; color: #6b7280;">
|
|
36
|
+
If the button doesn't work, copy and paste this link into your browser:
|
|
37
|
+
</p>
|
|
38
|
+
<p style="margin: 0 0 24px 0; font-size: 14px; color: #2563eb; word-break: break-all;">
|
|
39
|
+
{{verification_link}}
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<table role="presentation" style="background-color: #fef3c7; border-radius: 6px; margin: 0 0 24px 0;">
|
|
43
|
+
<tr>
|
|
44
|
+
<td style="padding: 16px;">
|
|
45
|
+
<p style="margin: 0; font-size: 14px; color: #92400e;">
|
|
46
|
+
<strong>Note:</strong> This link will expire in {{expiry_hours}} hours.
|
|
47
|
+
</p>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 24px 0;">
|
|
53
|
+
|
|
54
|
+
<p style="margin: 0; font-size: 14px; color: #6b7280;">
|
|
55
|
+
If you didn't create an account, you can safely ignore this email.
|
|
56
|
+
</p>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</table>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Verify Your Email Address
|
|
2
|
+
|
|
3
|
+
Hi {{user_name}},
|
|
4
|
+
|
|
5
|
+
Please click the link below to verify your email address and complete your registration:
|
|
6
|
+
|
|
7
|
+
{{verification_link}}
|
|
8
|
+
|
|
9
|
+
Note: This link will expire in {{expiry_hours}} hours.
|
|
10
|
+
|
|
11
|
+
If you didn't create an account, you can safely ignore this email.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Reset Your Password</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f5f5f5;">
|
|
9
|
+
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
10
|
+
<tr>
|
|
11
|
+
<td style="padding: 40px 20px;">
|
|
12
|
+
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
|
|
13
|
+
<tr>
|
|
14
|
+
<td style="padding: 40px;">
|
|
15
|
+
<h1 style="color: #dc2626; margin: 0 0 20px 0; font-size: 28px; font-weight: 600;">Reset Your Password</h1>
|
|
16
|
+
|
|
17
|
+
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4b5563;">
|
|
18
|
+
Hi {{user_name}},
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4b5563;">
|
|
22
|
+
We received a request to reset your password. Click the button below to create a new password:
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<table role="presentation" style="margin: 0 0 24px 0;">
|
|
26
|
+
<tr>
|
|
27
|
+
<td style="background-color: #dc2626; border-radius: 6px;">
|
|
28
|
+
<a href="{{reset_link}}" style="display: inline-block; padding: 14px 28px; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: 500;">
|
|
29
|
+
Reset Password
|
|
30
|
+
</a>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</table>
|
|
34
|
+
|
|
35
|
+
<p style="margin: 0 0 16px 0; font-size: 14px; color: #6b7280;">
|
|
36
|
+
If the button doesn't work, copy and paste this link into your browser:
|
|
37
|
+
</p>
|
|
38
|
+
<p style="margin: 0 0 24px 0; font-size: 14px; color: #2563eb; word-break: break-all;">
|
|
39
|
+
{{reset_link}}
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<table role="presentation" style="background-color: #fef2f2; border-radius: 6px; margin: 0 0 24px 0;">
|
|
43
|
+
<tr>
|
|
44
|
+
<td style="padding: 16px;">
|
|
45
|
+
<p style="margin: 0; font-size: 14px; color: #991b1b;">
|
|
46
|
+
<strong>Important:</strong> This link will expire in {{expiry_minutes}} minutes for security reasons.
|
|
47
|
+
</p>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 24px 0;">
|
|
53
|
+
|
|
54
|
+
<p style="margin: 0; font-size: 14px; color: #6b7280;">
|
|
55
|
+
If you didn't request a password reset, please ignore this email or contact support if you have concerns about your account security.
|
|
56
|
+
</p>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
</td>
|
|
61
|
+
</tr>
|
|
62
|
+
</table>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Reset Your Password
|
|
2
|
+
|
|
3
|
+
Hi {{user_name}},
|
|
4
|
+
|
|
5
|
+
We received a request to reset your password. Click the link below to create a new password:
|
|
6
|
+
|
|
7
|
+
{{reset_link}}
|
|
8
|
+
|
|
9
|
+
Important: This link will expire in {{expiry_minutes}} minutes for security reasons.
|
|
10
|
+
|
|
11
|
+
If you didn't request a password reset, please ignore this email or contact support if you have concerns about your account security.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"description": "Default email templates shipped with hazo_notify",
|
|
4
|
+
"templates": [
|
|
5
|
+
{
|
|
6
|
+
"template_name": "welcome_email",
|
|
7
|
+
"template_label": "Welcome Email",
|
|
8
|
+
"category": "System",
|
|
9
|
+
"html_file": "welcome_email.html",
|
|
10
|
+
"text_file": "welcome_email.txt",
|
|
11
|
+
"variables": [
|
|
12
|
+
{
|
|
13
|
+
"variable_name": "user_name",
|
|
14
|
+
"variable_description": "Recipient's full name"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"variable_name": "login_url",
|
|
18
|
+
"variable_description": "URL to login page"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"template_name": "email_verification",
|
|
24
|
+
"template_label": "Email Verification",
|
|
25
|
+
"category": "System",
|
|
26
|
+
"html_file": "email_verification.html",
|
|
27
|
+
"text_file": "email_verification.txt",
|
|
28
|
+
"variables": [
|
|
29
|
+
{
|
|
30
|
+
"variable_name": "user_name",
|
|
31
|
+
"variable_description": "Recipient's name"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"variable_name": "verification_link",
|
|
35
|
+
"variable_description": "Email verification URL"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"variable_name": "expiry_hours",
|
|
39
|
+
"variable_description": "Hours until link expires"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"template_name": "forgot_password",
|
|
45
|
+
"template_label": "Forgot Password",
|
|
46
|
+
"category": "System",
|
|
47
|
+
"html_file": "forgot_password.html",
|
|
48
|
+
"text_file": "forgot_password.txt",
|
|
49
|
+
"variables": [
|
|
50
|
+
{
|
|
51
|
+
"variable_name": "user_name",
|
|
52
|
+
"variable_description": "Recipient's name"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"variable_name": "reset_link",
|
|
56
|
+
"variable_description": "Password reset URL"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"variable_name": "expiry_minutes",
|
|
60
|
+
"variable_description": "Minutes until link expires"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"template_name": "email_signature",
|
|
66
|
+
"template_label": "Email Signature",
|
|
67
|
+
"category": "System",
|
|
68
|
+
"html_file": "email_signature.html",
|
|
69
|
+
"text_file": "email_signature.txt",
|
|
70
|
+
"variables": [
|
|
71
|
+
{
|
|
72
|
+
"variable_name": "sender_name",
|
|
73
|
+
"variable_description": "Sender's name"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"variable_name": "sender_title",
|
|
77
|
+
"variable_description": "Sender's job title"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"variable_name": "company_name",
|
|
81
|
+
"variable_description": "Company name"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Welcome</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f5f5f5;">
|
|
9
|
+
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
10
|
+
<tr>
|
|
11
|
+
<td style="padding: 40px 20px;">
|
|
12
|
+
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
|
|
13
|
+
<tr>
|
|
14
|
+
<td style="padding: 40px;">
|
|
15
|
+
<h1 style="color: #2563eb; margin: 0 0 20px 0; font-size: 28px; font-weight: 600;">Welcome, {{user_name}}!</h1>
|
|
16
|
+
|
|
17
|
+
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4b5563;">
|
|
18
|
+
Thank you for joining us. We're excited to have you on board and can't wait to help you get started.
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4b5563;">
|
|
22
|
+
To access your account, simply click the button below:
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<table role="presentation" style="margin: 0 0 24px 0;">
|
|
26
|
+
<tr>
|
|
27
|
+
<td style="background-color: #2563eb; border-radius: 6px;">
|
|
28
|
+
<a href="{{login_url}}" style="display: inline-block; padding: 14px 28px; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: 500;">
|
|
29
|
+
Login to Your Account
|
|
30
|
+
</a>
|
|
31
|
+
</td>
|
|
32
|
+
</tr>
|
|
33
|
+
</table>
|
|
34
|
+
|
|
35
|
+
<p style="margin: 0 0 16px 0; font-size: 14px; color: #6b7280;">
|
|
36
|
+
If the button doesn't work, copy and paste this link into your browser:
|
|
37
|
+
</p>
|
|
38
|
+
<p style="margin: 0 0 24px 0; font-size: 14px; color: #2563eb; word-break: break-all;">
|
|
39
|
+
{{login_url}}
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<hr style="border: none; border-top: 1px solid #e5e7eb; margin: 24px 0;">
|
|
43
|
+
|
|
44
|
+
<p style="margin: 0; font-size: 14px; color: #6b7280;">
|
|
45
|
+
If you have any questions, feel free to reach out to our support team. We're here to help!
|
|
46
|
+
</p>
|
|
47
|
+
</td>
|
|
48
|
+
</tr>
|
|
49
|
+
</table>
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
</table>
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Welcome, {{user_name}}!
|
|
2
|
+
|
|
3
|
+
Thank you for joining us. We're excited to have you on board and can't wait to help you get started.
|
|
4
|
+
|
|
5
|
+
To access your account, visit:
|
|
6
|
+
{{login_url}}
|
|
7
|
+
|
|
8
|
+
If you have any questions, feel free to reach out to our support team. We're here to help!
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Reads configuration from hazo_notify_config.ini via hazo_config package
|
|
4
4
|
* and sends emails using the configured provider
|
|
5
5
|
*/
|
|
6
|
-
import { EmailerConfig, SendEmailOptions, EmailSendResponse } from './types';
|
|
6
|
+
import type { EmailerConfig, SendEmailOptions, EmailSendResponse } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* Load emailer configuration from hazo_notify_config.ini
|
|
9
9
|
* @returns Emailer configuration
|
|
@@ -11,7 +11,7 @@ import { EmailerConfig, SendEmailOptions, EmailSendResponse } from './types';
|
|
|
11
11
|
export declare function load_emailer_config(): EmailerConfig;
|
|
12
12
|
/**
|
|
13
13
|
* Send email using the configured provider
|
|
14
|
-
* @param options - Email send options
|
|
14
|
+
* @param options - Email send options (includes optional logger)
|
|
15
15
|
* @param config - Optional emailer configuration (if not provided, loads from config file)
|
|
16
16
|
* @returns Promise with email send response
|
|
17
17
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailer.d.ts","sourceRoot":"","sources":["../../src/lib/emailer/emailer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAiB,MAAM,SAAS,CAAC;AAEjG;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAwJnD;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CA0H5B"}
|
|
@@ -52,10 +52,12 @@ function load_emailer_config() {
|
|
|
52
52
|
};
|
|
53
53
|
// Load Zeptomail API configuration if emailer_module is 'zeptoemail_api'
|
|
54
54
|
if (emailer_module === 'zeptoemail_api') {
|
|
55
|
-
config.zeptomail_api_endpoint =
|
|
55
|
+
config.zeptomail_api_endpoint =
|
|
56
|
+
emailer_section?.zeptomail_api_endpoint ||
|
|
57
|
+
'https://api.zeptomail.com.au/v1.1/email';
|
|
56
58
|
// Prioritize environment variables over config file for security
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
config.zeptomail_api_key =
|
|
60
|
+
process.env.ZEPTOMAIL_API_KEY || emailer_section?.zeptomail_api_key || '';
|
|
59
61
|
}
|
|
60
62
|
// Load optional configuration
|
|
61
63
|
if (emailer_section?.reply_to_email) {
|
|
@@ -67,24 +69,24 @@ function load_emailer_config() {
|
|
|
67
69
|
if (emailer_section?.return_path_email) {
|
|
68
70
|
config.return_path_email = emailer_section.return_path_email;
|
|
69
71
|
}
|
|
70
|
-
// Load SMTP configuration if emailer_module is 'smtp'
|
|
72
|
+
// Load SMTP configuration if emailer_module is 'smtp'
|
|
71
73
|
if (emailer_module === 'smtp') {
|
|
72
74
|
config.smtp_host = emailer_section?.smtp_host || '';
|
|
73
75
|
config.smtp_port = parseInt(emailer_section?.smtp_port || '587', 10);
|
|
74
|
-
const smtp_secure_value = emailer_section?.smtp_secure;
|
|
75
|
-
config.smtp_secure = smtp_secure_value === 'true'
|
|
76
|
+
const smtp_secure_value = String(emailer_section?.smtp_secure || '');
|
|
77
|
+
config.smtp_secure = smtp_secure_value === 'true';
|
|
76
78
|
config.smtp_auth_user = emailer_section?.smtp_auth_user || '';
|
|
77
79
|
config.smtp_auth_pass = emailer_section?.smtp_auth_pass || '';
|
|
78
80
|
config.smtp_timeout = parseInt(emailer_section?.smtp_timeout || '5000', 10);
|
|
79
|
-
const smtp_pool_value = emailer_section?.smtp_pool;
|
|
80
|
-
config.smtp_pool = smtp_pool_value === 'true'
|
|
81
|
+
const smtp_pool_value = String(emailer_section?.smtp_pool || '');
|
|
82
|
+
config.smtp_pool = smtp_pool_value === 'true';
|
|
81
83
|
}
|
|
82
|
-
// Load POP3 configuration if emailer_module is 'pop3'
|
|
84
|
+
// Load POP3 configuration if emailer_module is 'pop3'
|
|
83
85
|
if (emailer_module === 'pop3') {
|
|
84
86
|
config.pop3_host = emailer_section?.pop3_host || '';
|
|
85
87
|
config.pop3_port = parseInt(emailer_section?.pop3_port || '995', 10);
|
|
86
|
-
const pop3_secure_value = emailer_section?.pop3_secure;
|
|
87
|
-
config.pop3_secure = pop3_secure_value === 'true'
|
|
88
|
+
const pop3_secure_value = String(emailer_section?.pop3_secure || '');
|
|
89
|
+
config.pop3_secure = pop3_secure_value === 'true';
|
|
88
90
|
config.pop3_auth_user = emailer_section?.pop3_auth_user || '';
|
|
89
91
|
config.pop3_auth_pass = emailer_section?.pop3_auth_pass || '';
|
|
90
92
|
config.pop3_timeout = parseInt(emailer_section?.pop3_timeout || '5000', 10);
|
|
@@ -111,20 +113,26 @@ function load_emailer_config() {
|
|
|
111
113
|
const error_message = error instanceof Error ? error.message : 'Failed to load emailer configuration';
|
|
112
114
|
const error_string = error instanceof Error ? error.toString() : String(error);
|
|
113
115
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
114
|
-
|
|
116
|
+
// Use fallback logger for config loading errors
|
|
117
|
+
const logger = (0, logger_1.get_logger)();
|
|
118
|
+
logger.error(error_message, {
|
|
119
|
+
filename,
|
|
120
|
+
function_name,
|
|
115
121
|
line_number: stack || 'unknown',
|
|
116
122
|
error: error_string,
|
|
117
|
-
})
|
|
123
|
+
});
|
|
118
124
|
throw new Error(`Failed to load emailer configuration: ${error_message}`);
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
127
|
/**
|
|
122
128
|
* Send email using the configured provider
|
|
123
|
-
* @param options - Email send options
|
|
129
|
+
* @param options - Email send options (includes optional logger)
|
|
124
130
|
* @param config - Optional emailer configuration (if not provided, loads from config file)
|
|
125
131
|
* @returns Promise with email send response
|
|
126
132
|
*/
|
|
127
133
|
async function send_email(options, config) {
|
|
134
|
+
// Get logger from options or use fallback
|
|
135
|
+
const logger = (0, logger_1.get_logger)(options.logger);
|
|
128
136
|
const filename = 'emailer.ts';
|
|
129
137
|
const function_name = 'send_email';
|
|
130
138
|
try {
|
|
@@ -173,11 +181,13 @@ async function send_email(options, config) {
|
|
|
173
181
|
}
|
|
174
182
|
// Get appropriate provider
|
|
175
183
|
const provider = (0, providers_1.get_email_provider)(emailer_config);
|
|
176
|
-
// Send email
|
|
177
|
-
const response = await provider.send_email(options, emailer_config);
|
|
184
|
+
// Send email - pass logger to provider
|
|
185
|
+
const response = await provider.send_email(options, emailer_config, logger);
|
|
178
186
|
// Log error if email sending failed
|
|
179
187
|
if (!response.success) {
|
|
180
|
-
|
|
188
|
+
logger.error(response.error || 'Failed to send email', {
|
|
189
|
+
filename,
|
|
190
|
+
function_name,
|
|
181
191
|
options: {
|
|
182
192
|
to: options.to,
|
|
183
193
|
subject: options.subject,
|
|
@@ -186,7 +196,7 @@ async function send_email(options, config) {
|
|
|
186
196
|
attachments_count: options.attachments?.length || 0,
|
|
187
197
|
},
|
|
188
198
|
response: response.raw_response,
|
|
189
|
-
})
|
|
199
|
+
});
|
|
190
200
|
}
|
|
191
201
|
return response;
|
|
192
202
|
}
|
|
@@ -195,7 +205,9 @@ async function send_email(options, config) {
|
|
|
195
205
|
const error_string = error instanceof Error ? error.toString() : String(error);
|
|
196
206
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
197
207
|
const is_production = process.env.NODE_ENV === 'production';
|
|
198
|
-
|
|
208
|
+
logger.error(error_message, {
|
|
209
|
+
filename,
|
|
210
|
+
function_name,
|
|
199
211
|
line_number: stack || 'unknown',
|
|
200
212
|
error: error_string,
|
|
201
213
|
options: {
|
|
@@ -205,15 +217,17 @@ async function send_email(options, config) {
|
|
|
205
217
|
has_html: !!options.content.html,
|
|
206
218
|
attachments_count: options.attachments?.length || 0,
|
|
207
219
|
},
|
|
208
|
-
})
|
|
220
|
+
});
|
|
209
221
|
return {
|
|
210
222
|
success: false,
|
|
211
223
|
error: error_message,
|
|
212
224
|
message: error_message,
|
|
213
|
-
raw_response: is_production
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
225
|
+
raw_response: is_production
|
|
226
|
+
? undefined
|
|
227
|
+
: {
|
|
228
|
+
error: error_string,
|
|
229
|
+
stack: stack,
|
|
230
|
+
},
|
|
217
231
|
};
|
|
218
232
|
}
|
|
219
233
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailer.js","sourceRoot":"","sources":["../../src/lib/emailer/emailer.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA4BH,kDAwJC;AAQD,gCA6HC;AAvTD,2CAAiD;AACjD,6CAAyC;AACzC,+BAA4B;AAC5B,iDAS2B;AAC3B,2CAA4C;AAC5C,mDAK4B;AAG5B;;;GA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Aa,EAAE;YAC1B,QAAQ;YACR,aAAa;YACb,WAAW,EAAE,KAAK,IAAI,SAAS;YAC/B,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;gBAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;gBAChC,iBAAiB,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;aACpD;SACF,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,aAAa;YACtB,YAAY,EAAE,aAAa;gBACzB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC;oBACE,KAAK,EAAE,YAAY;oBACnB,KAAK,EAAE,KAAK;iBACb;SACN,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -8,4 +8,5 @@ export { get_email_provider } from './providers';
|
|
|
8
8
|
export { ZeptomailProvider } from './providers/zeptomail_provider';
|
|
9
9
|
export { SmtpProvider } from './providers/smtp_provider';
|
|
10
10
|
export { Pop3Provider } from './providers/pop3_provider';
|
|
11
|
+
export { create_fallback_logger, get_logger } from './utils/logger';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/emailer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Pop3Provider = exports.SmtpProvider = exports.ZeptomailProvider = exports.get_email_provider = exports.load_emailer_config = exports.send_email = void 0;
|
|
21
|
+
exports.get_logger = exports.create_fallback_logger = exports.Pop3Provider = exports.SmtpProvider = exports.ZeptomailProvider = exports.get_email_provider = exports.load_emailer_config = exports.send_email = void 0;
|
|
22
22
|
var emailer_1 = require("./emailer");
|
|
23
23
|
Object.defineProperty(exports, "send_email", { enumerable: true, get: function () { return emailer_1.send_email; } });
|
|
24
24
|
Object.defineProperty(exports, "load_emailer_config", { enumerable: true, get: function () { return emailer_1.load_emailer_config; } });
|
|
@@ -31,4 +31,8 @@ var smtp_provider_1 = require("./providers/smtp_provider");
|
|
|
31
31
|
Object.defineProperty(exports, "SmtpProvider", { enumerable: true, get: function () { return smtp_provider_1.SmtpProvider; } });
|
|
32
32
|
var pop3_provider_1 = require("./providers/pop3_provider");
|
|
33
33
|
Object.defineProperty(exports, "Pop3Provider", { enumerable: true, get: function () { return pop3_provider_1.Pop3Provider; } });
|
|
34
|
+
// Logger utilities for consumers
|
|
35
|
+
var logger_1 = require("./utils/logger");
|
|
36
|
+
Object.defineProperty(exports, "create_fallback_logger", { enumerable: true, get: function () { return logger_1.create_fallback_logger; } });
|
|
37
|
+
Object.defineProperty(exports, "get_logger", { enumerable: true, get: function () { return logger_1.get_logger; } });
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/emailer/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,qCAA4D;AAAnD,qGAAA,UAAU,OAAA;AAAE,8GAAA,mBAAmB,OAAA;AACxC,0CAAwB;AACxB,yCAAiD;AAAxC,+GAAA,kBAAkB,OAAA;AAC3B,qEAAmE;AAA1D,uHAAA,iBAAiB,OAAA;AAC1B,2DAAyD;AAAhD,6GAAA,YAAY,OAAA;AACrB,2DAAyD;AAAhD,6GAAA,YAAY,OAAA;AACrB,iCAAiC;AACjC,yCAAoE;AAA3D,gHAAA,sBAAsB,OAAA;AAAE,oGAAA,UAAU,OAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provider factory for email providers
|
|
3
3
|
* Selects and returns the appropriate provider based on configuration
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { EmailerConfig, EmailProvider } from '../types';
|
|
6
6
|
/**
|
|
7
7
|
* Get email provider based on configuration module
|
|
8
8
|
* @param config - Emailer configuration
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/emailer/providers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAavE;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/emailer/providers/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH,gDAaC;AAvBD,6DAAyD;AACzD,mDAA+C;AAC/C,mDAA+C;AAG/C;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,MAAqB;IACtD,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,gBAAgB,CAAC;IAEjE,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,gBAAgB;YACnB,OAAO,IAAI,sCAAiB,EAAE,CAAC;QACjC,KAAK,MAAM;YACT,OAAO,IAAI,4BAAY,EAAE,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,IAAI,4BAAY,EAAE,CAAC;QAC5B;YACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA"}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* POP3 provider implementation (placeholder)
|
|
3
3
|
* This provider is not yet implemented and will return an error
|
|
4
4
|
*/
|
|
5
|
-
import { EmailProvider, SendEmailOptions, EmailerConfig, EmailSendResponse } from '../types';
|
|
5
|
+
import type { EmailProvider, SendEmailOptions, EmailerConfig, EmailSendResponse, Logger } from '../types';
|
|
6
6
|
export declare class Pop3Provider implements EmailProvider {
|
|
7
7
|
/**
|
|
8
8
|
* Send email using POP3 (not implemented)
|
|
9
9
|
* @param options - Email send options
|
|
10
10
|
* @param config - Emailer configuration
|
|
11
|
+
* @param logger - Optional logger instance
|
|
11
12
|
* @returns Promise with error response
|
|
12
13
|
*/
|
|
13
|
-
send_email(options: SendEmailOptions, config: EmailerConfig): Promise<EmailSendResponse>;
|
|
14
|
+
send_email(options: SendEmailOptions, config: EmailerConfig, logger?: Logger): Promise<EmailSendResponse>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=pop3_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pop3_provider.d.ts","sourceRoot":"","sources":["../../../src/lib/emailer/providers/pop3_provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,qBAAa,YAAa,YAAW,aAAa;IAChD;;;;;;OAMG;IACG,UAAU,CACd,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC;CAY9B"}
|
|
@@ -10,9 +10,10 @@ class Pop3Provider {
|
|
|
10
10
|
* Send email using POP3 (not implemented)
|
|
11
11
|
* @param options - Email send options
|
|
12
12
|
* @param config - Emailer configuration
|
|
13
|
+
* @param logger - Optional logger instance
|
|
13
14
|
* @returns Promise with error response
|
|
14
15
|
*/
|
|
15
|
-
async send_email(options, config) {
|
|
16
|
+
async send_email(options, config, logger) {
|
|
16
17
|
return {
|
|
17
18
|
success: false,
|
|
18
19
|
error: 'POP3 provider is not yet implemented',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pop3_provider.js","sourceRoot":"","sources":["../../../src/lib/emailer/providers/pop3_provider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,MAAa,YAAY;IACvB;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CACd,OAAyB,EACzB,MAAqB,EACrB,MAAe;QAEf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,sCAAsC;YAC7C,OAAO,EAAE,sEAAsE;YAC/E,YAAY,EAAE;gBACZ,QAAQ,EAAE,MAAM;gBAChB,MAAM,EAAE,iBAAiB;gBACzB,OAAO,EAAE,4EAA4E;aACtF;SACF,CAAC;IACJ,CAAC;CACF;AAxBD,oCAwBC"}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* SMTP provider implementation (placeholder)
|
|
3
3
|
* This provider is not yet implemented and will return an error
|
|
4
4
|
*/
|
|
5
|
-
import { EmailProvider, SendEmailOptions, EmailerConfig, EmailSendResponse } from '../types';
|
|
5
|
+
import type { EmailProvider, SendEmailOptions, EmailerConfig, EmailSendResponse, Logger } from '../types';
|
|
6
6
|
export declare class SmtpProvider implements EmailProvider {
|
|
7
7
|
/**
|
|
8
8
|
* Send email using SMTP (not implemented)
|
|
9
9
|
* @param options - Email send options
|
|
10
10
|
* @param config - Emailer configuration
|
|
11
|
+
* @param logger - Optional logger instance
|
|
11
12
|
* @returns Promise with error response
|
|
12
13
|
*/
|
|
13
|
-
send_email(options: SendEmailOptions, config: EmailerConfig): Promise<EmailSendResponse>;
|
|
14
|
+
send_email(options: SendEmailOptions, config: EmailerConfig, logger?: Logger): Promise<EmailSendResponse>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=smtp_provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smtp_provider.d.ts","sourceRoot":"","sources":["../../../src/lib/emailer/providers/smtp_provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,qBAAa,YAAa,YAAW,aAAa;IAChD;;;;;;OAMG;IACG,UAAU,CACd,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC;CAY9B"}
|