tzmail 1.0.4 → 1.0.5
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.
|
@@ -45,7 +45,7 @@ export interface IFooterConfig {
|
|
|
45
45
|
url: string;
|
|
46
46
|
}>;
|
|
47
47
|
socialLinks?: Array<{
|
|
48
|
-
platform: 'facebook' | 'twitter' | 'linkedin' | 'github';
|
|
48
|
+
platform: 'facebook' | 'twitter' | 'linkedin' | 'github' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'reddit' | 'pinterest' | 'tiktok' | 'gitlab' | 'stackoverflow' | 'medium' | 'dribbble' | 'behance' | 'telegram';
|
|
49
49
|
url: string;
|
|
50
50
|
}>;
|
|
51
51
|
copyrightText?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.interface.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/template.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;KACrC,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"template.interface.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/template.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;KACrC,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;QAC9N,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SystemTheme = exports.MonokaiTheme = exports.ModernTheme = exports.MinimalTheme = exports.CorporateTheme = exports.TemplateBuilder = exports.AttachmentService = exports.EmailService = exports.TemplateService = exports.ThemeType = exports.TemplateFactory = exports.EmailFactory = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const email_factory_1 = require("./factories/email-factory");
|
|
10
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
11
|
-
const attachment_service_1 = require("./services/attachment.service");
|
|
12
|
-
dotenv_1.default.config();
|
|
13
|
-
var email_factory_2 = require("./factories/email-factory");
|
|
14
|
-
Object.defineProperty(exports, "EmailFactory", { enumerable: true, get: function () { return email_factory_2.EmailFactory; } });
|
|
4
|
+
var email_factory_1 = require("./factories/email-factory");
|
|
5
|
+
Object.defineProperty(exports, "EmailFactory", { enumerable: true, get: function () { return email_factory_1.EmailFactory; } });
|
|
15
6
|
var template_factory_1 = require("./factories/template-factory");
|
|
16
7
|
Object.defineProperty(exports, "TemplateFactory", { enumerable: true, get: function () { return template_factory_1.TemplateFactory; } });
|
|
17
|
-
var
|
|
18
|
-
Object.defineProperty(exports, "ThemeType", { enumerable: true, get: function () { return
|
|
8
|
+
var theme_enum_1 = require("./core/enums/theme.enum");
|
|
9
|
+
Object.defineProperty(exports, "ThemeType", { enumerable: true, get: function () { return theme_enum_1.ThemeType; } });
|
|
19
10
|
var template_service_1 = require("./services/template.service");
|
|
20
11
|
Object.defineProperty(exports, "TemplateService", { enumerable: true, get: function () { return template_service_1.TemplateService; } });
|
|
21
12
|
var email_service_1 = require("./services/email.service");
|
|
22
13
|
Object.defineProperty(exports, "EmailService", { enumerable: true, get: function () { return email_service_1.EmailService; } });
|
|
23
|
-
var
|
|
24
|
-
Object.defineProperty(exports, "AttachmentService", { enumerable: true, get: function () { return
|
|
14
|
+
var attachment_service_1 = require("./services/attachment.service");
|
|
15
|
+
Object.defineProperty(exports, "AttachmentService", { enumerable: true, get: function () { return attachment_service_1.AttachmentService; } });
|
|
25
16
|
var template_builder_1 = require("./templates/base/template-builder");
|
|
26
17
|
Object.defineProperty(exports, "TemplateBuilder", { enumerable: true, get: function () { return template_builder_1.TemplateBuilder; } });
|
|
27
18
|
var corporate_theme_1 = require("./templates/themes/corporate.theme");
|
|
@@ -34,232 +25,3 @@ var monokai_theme_1 = require("./templates/themes/monokai.theme");
|
|
|
34
25
|
Object.defineProperty(exports, "MonokaiTheme", { enumerable: true, get: function () { return monokai_theme_1.MonokaiTheme; } });
|
|
35
26
|
var system_theme_1 = require("./templates/themes/system.theme");
|
|
36
27
|
Object.defineProperty(exports, "SystemTheme", { enumerable: true, get: function () { return system_theme_1.SystemTheme; } });
|
|
37
|
-
/*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* *
|
|
41
|
-
* *
|
|
42
|
-
* * tzMail - Servidor de Teste
|
|
43
|
-
*/
|
|
44
|
-
const app = (0, express_1.default)();
|
|
45
|
-
const PORT = 3001;
|
|
46
|
-
app.use(express_1.default.json());
|
|
47
|
-
app.use(express_1.default.urlencoded({ extended: true }));
|
|
48
|
-
const SMTP_CONFIG = {
|
|
49
|
-
host: 'smtp.gmail.com',
|
|
50
|
-
port: 587,
|
|
51
|
-
secure: false,
|
|
52
|
-
auth: {
|
|
53
|
-
user: process.env.SMTP_USER,
|
|
54
|
-
pass: process.env.SMTP_PASS
|
|
55
|
-
},
|
|
56
|
-
defaultFrom: 'LyraX Corp <lyrax.com@gmail.com>'
|
|
57
|
-
};
|
|
58
|
-
// init EmailFactory
|
|
59
|
-
const emailFactory = email_factory_1.EmailFactory.initialize(SMTP_CONFIG);
|
|
60
|
-
const templateService = emailFactory.getTemplateService();
|
|
61
|
-
// modern
|
|
62
|
-
const modernTemplate = templateService.createTemplate(theme_enum_1.ThemeType.MODERN, 'light', {
|
|
63
|
-
header: {
|
|
64
|
-
show: true,
|
|
65
|
-
logo: {
|
|
66
|
-
type: 'image',
|
|
67
|
-
imageUrl: 'https://talkspace-ten.vercel.app/_next/image?url=%2Flogo%2Ftalkspace-banner.png&w=640&q=75',
|
|
68
|
-
size: 'large'
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
body: {
|
|
72
|
-
title: 'Bem-vindo ao LyraX!',
|
|
73
|
-
message: 'Estamos felizes em tê-lo conosco. Explore nossos recursos e aproveite ao máximo a experiência.',
|
|
74
|
-
buttonText: 'Começar Agora',
|
|
75
|
-
buttonUrl: 'https://meuapp.com/get-started',
|
|
76
|
-
buttonVariant: 'primary',
|
|
77
|
-
alignment: 'center',
|
|
78
|
-
fontSize: 16
|
|
79
|
-
},
|
|
80
|
-
footer: {
|
|
81
|
-
show: true,
|
|
82
|
-
links: [
|
|
83
|
-
{ text: 'Política', url: 'https://meuapp.com/politica' },
|
|
84
|
-
{ text: 'Termos', url: 'https://meuapp.com/termos' }
|
|
85
|
-
],
|
|
86
|
-
socialLinks: [
|
|
87
|
-
{ platform: 'facebook', url: 'https://facebook.com/meuapp' },
|
|
88
|
-
{ platform: 'twitter', url: 'https://twitter.com/meuapp' },
|
|
89
|
-
{ platform: 'linkedin', url: 'https://linkedin.com/company/meuapp' }
|
|
90
|
-
],
|
|
91
|
-
copyrightText: '© 2024 Meu App',
|
|
92
|
-
unsubscribeText: 'Cancelar inscrição'
|
|
93
|
-
},
|
|
94
|
-
layout: 'full',
|
|
95
|
-
spacing: 'normal',
|
|
96
|
-
borderRadius: 'medium'
|
|
97
|
-
});
|
|
98
|
-
// monokai
|
|
99
|
-
const monokaiTemplate = templateService.createTemplate(theme_enum_1.ThemeType.MONOKAI, 'light', {
|
|
100
|
-
header: {
|
|
101
|
-
show: true,
|
|
102
|
-
logo: {
|
|
103
|
-
type: 'text',
|
|
104
|
-
text: 'DevHub',
|
|
105
|
-
size: 'medium'
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
body: {
|
|
109
|
-
title: 'DevHub Newsletter - Novidades da Semana',
|
|
110
|
-
message: 'Olá DevHubbers!\n\nConfira as últimas novidades, tutoriais e eventos da comunidade DevHub. Fique por dentro de tudo que está acontecendo no mundo do desenvolvimento! \n <code>console.log("Stay Dev!");</code>',
|
|
111
|
-
buttonText: 'Visitar DevHub',
|
|
112
|
-
buttonUrl: 'https://devhub.com',
|
|
113
|
-
buttonVariant: 'primary',
|
|
114
|
-
alignment: 'center',
|
|
115
|
-
fontSize: 16
|
|
116
|
-
},
|
|
117
|
-
footer: {
|
|
118
|
-
show: true,
|
|
119
|
-
links: [
|
|
120
|
-
{ text: 'GitHub', url: 'https://github.com' },
|
|
121
|
-
{ text: 'Docs', url: 'https://docs.com' }
|
|
122
|
-
],
|
|
123
|
-
socialLinks: [
|
|
124
|
-
{ platform: 'twitter', url: 'https://twitter.com' },
|
|
125
|
-
{ platform: 'linkedin', url: 'https://linkedin.com' }
|
|
126
|
-
],
|
|
127
|
-
copyrightText: '© 2024 DevHub'
|
|
128
|
-
},
|
|
129
|
-
layout: 'full',
|
|
130
|
-
spacing: 'normal',
|
|
131
|
-
borderRadius: 'small'
|
|
132
|
-
});
|
|
133
|
-
// corporate
|
|
134
|
-
const corporateTemplate = templateService.createTemplate(theme_enum_1.ThemeType.CORPORATE, 'dark', {
|
|
135
|
-
header: {
|
|
136
|
-
show: true,
|
|
137
|
-
logo: {
|
|
138
|
-
type: 'image',
|
|
139
|
-
imageUrl: 'https://talkspace-ten.vercel.app/_next/image?url=%2Flogo%2Ftalkspace-banner.png&w=640&q=75',
|
|
140
|
-
size: 'large'
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
body: {
|
|
144
|
-
title: 'Relatório Trimestral - Q4 2024',
|
|
145
|
-
message: 'Prezado(a) colaborador(a),\n\nSegue o relatório trimestral com os principais indicadores e resultados alcançados no último trimestre. Agradecemos a dedicação de todos e seguimos juntos rumo ao sucesso!',
|
|
146
|
-
buttonText: 'Ver Relatório Completo',
|
|
147
|
-
buttonUrl: 'https://lyrax.com/relatorio-q4-2024',
|
|
148
|
-
buttonVariant: 'primary'
|
|
149
|
-
},
|
|
150
|
-
footer: {
|
|
151
|
-
show: true,
|
|
152
|
-
links: [
|
|
153
|
-
{ text: 'Sobre', url: 'https://empresa.com/sobre' },
|
|
154
|
-
{ text: 'Imprensa', url: 'https://empresa.com/imprensa' },
|
|
155
|
-
{ text: 'Carreiras', url: 'https://empresa.com/carreiras' },
|
|
156
|
-
{ text: 'Contato', url: 'https://empresa.com/contato' }
|
|
157
|
-
],
|
|
158
|
-
copyrightText: '© 2024 Empresa Ltda'
|
|
159
|
-
},
|
|
160
|
-
layout: 'full',
|
|
161
|
-
spacing: 'normal',
|
|
162
|
-
borderRadius: 'small'
|
|
163
|
-
});
|
|
164
|
-
// minimal
|
|
165
|
-
const minimalTemplate = templateService.createTemplate(theme_enum_1.ThemeType.MINIMAL, 'dark', {
|
|
166
|
-
header: {
|
|
167
|
-
show: true,
|
|
168
|
-
logo: {
|
|
169
|
-
type: 'text',
|
|
170
|
-
text: 'TalkSpace',
|
|
171
|
-
size: 'medium'
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
body: {
|
|
175
|
-
title: 'Pensamentos sobre design',
|
|
176
|
-
message: 'Design é mais do que estética - é sobre criar experiências significativas. Em um mundo saturado de informações, o design minimalista nos lembra que menos é mais. Ao eliminar o excesso, podemos destacar o essencial e criar conexões mais profundas com nosso público. Menos distrações, mais impacto.',
|
|
177
|
-
buttonText: 'Explorar Mais',
|
|
178
|
-
buttonUrl: 'https://talkspace.com/design-thoughts',
|
|
179
|
-
buttonVariant: 'primary',
|
|
180
|
-
alignment: 'center',
|
|
181
|
-
fontSize: 16
|
|
182
|
-
},
|
|
183
|
-
footer: {
|
|
184
|
-
show: true,
|
|
185
|
-
links: [
|
|
186
|
-
{ text: 'Sobre', url: 'https://empresa.com/sobre' },
|
|
187
|
-
{ text: 'Imprensa', url: 'https://empresa.com/imprensa' },
|
|
188
|
-
{ text: 'Carreiras', url: 'https://empresa.com/carreiras' },
|
|
189
|
-
{ text: 'Contato', url: 'https://empresa.com/contato' }
|
|
190
|
-
],
|
|
191
|
-
socialLinks: [
|
|
192
|
-
{ platform: 'facebook', url: 'https://facebook.com' },
|
|
193
|
-
{ platform: 'twitter', url: 'https://twitter.com' },
|
|
194
|
-
{ platform: 'linkedin', url: 'https://linkedin.com' }
|
|
195
|
-
],
|
|
196
|
-
copyrightText: 'TalkSpace'
|
|
197
|
-
},
|
|
198
|
-
layout: 'minimal',
|
|
199
|
-
spacing: 'relaxed',
|
|
200
|
-
borderRadius: 'none'
|
|
201
|
-
});
|
|
202
|
-
async function sendWelcomeEmail(to) {
|
|
203
|
-
console.log(`\n📧 Enviando email de boas-vindas para ${to}...`);
|
|
204
|
-
const result = await emailFactory.sendEmail({
|
|
205
|
-
to,
|
|
206
|
-
subject: 'Bem-vindo ao Meu App!',
|
|
207
|
-
template: modernTemplate
|
|
208
|
-
});
|
|
209
|
-
console.log('Resultado:', result);
|
|
210
|
-
return result;
|
|
211
|
-
}
|
|
212
|
-
async function sendTechNewsletter(to) {
|
|
213
|
-
console.log(`\n📧 Enviando newsletter técnica para ${to}...`);
|
|
214
|
-
const result = await emailFactory.sendEmail({
|
|
215
|
-
to,
|
|
216
|
-
subject: 'DevHub Newsletter - Novidades da Semana',
|
|
217
|
-
template: monokaiTemplate
|
|
218
|
-
});
|
|
219
|
-
console.log('Resultado:', result);
|
|
220
|
-
return result;
|
|
221
|
-
}
|
|
222
|
-
async function sendCorporateReport(to) {
|
|
223
|
-
console.log(`\n📧 Enviando relatório corporativo para ${to}...`);
|
|
224
|
-
const result = await emailFactory.sendEmail({
|
|
225
|
-
to,
|
|
226
|
-
subject: 'Relatório Trimestral - Q4 2024',
|
|
227
|
-
template: corporateTemplate,
|
|
228
|
-
});
|
|
229
|
-
console.log('Resultado:', result);
|
|
230
|
-
return result;
|
|
231
|
-
}
|
|
232
|
-
async function sendMinimalNewsletter(to) {
|
|
233
|
-
console.log(`\n📧 Enviando newsletter minimalista para ${to}...`);
|
|
234
|
-
const attachmentService = new attachment_service_1.AttachmentService();
|
|
235
|
-
const attachment = await attachmentService.addFromPath('uploads/PHOTO.jpg');
|
|
236
|
-
const result = await emailFactory.sendEmail({
|
|
237
|
-
to,
|
|
238
|
-
subject: 'Pensamentos sobre design',
|
|
239
|
-
template: minimalTemplate,
|
|
240
|
-
attachments: [
|
|
241
|
-
{
|
|
242
|
-
...attachment
|
|
243
|
-
}
|
|
244
|
-
]
|
|
245
|
-
});
|
|
246
|
-
console.log('Resultado:', result);
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
app.get('/test', async (req, res) => {
|
|
250
|
-
const result = await sendMinimalNewsletter('antiquesclub007@gmail.com');
|
|
251
|
-
res.json(result);
|
|
252
|
-
});
|
|
253
|
-
app.listen(PORT, () => {
|
|
254
|
-
console.log(`
|
|
255
|
-
╔═══════════════════════════════════════════════════╗
|
|
256
|
-
║ ║
|
|
257
|
-
║ 📧 tzMail - Servidor de Teste ║
|
|
258
|
-
║ ║
|
|
259
|
-
║ 🚀 Servidor rodando em: http://localhost:${PORT} ║
|
|
260
|
-
║ ║
|
|
261
|
-
║ ⚠️ Configure seu SMTP no arquivo src/index.ts ║
|
|
262
|
-
║ ║
|
|
263
|
-
╚═══════════════════════════════════════════════════╝
|
|
264
|
-
`);
|
|
265
|
-
});
|