@mailmodo/cli 0.0.19-beta.pr21.30 → 0.0.19-beta.pr21.31
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/dist/commands/preview/index.js +12 -4
- package/oclif.manifest.json +73 -73
- package/package.json +1 -1
|
@@ -84,11 +84,14 @@ export default class Preview extends BaseCommand {
|
|
|
84
84
|
app_url: yamlConfig.project?.url || 'https://yourapp.com', // eslint-disable-line camelcase
|
|
85
85
|
product_name: yamlConfig.project?.name || 'YourApp', // eslint-disable-line camelcase
|
|
86
86
|
};
|
|
87
|
+
const templateHtml = await loadTemplate(`${email.id}.html`);
|
|
87
88
|
if (flags.send) {
|
|
88
|
-
|
|
89
|
+
const rendered = templateHtml
|
|
90
|
+
? renderTemplate(templateHtml, sampleData)
|
|
91
|
+
: '';
|
|
92
|
+
await this.sendTestEmail(email, rendered, yamlConfig.project?.domain, flags.send, flags.json);
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
|
-
const templateHtml = await loadTemplate(`${email.id}.html`);
|
|
92
95
|
if (flags.text) {
|
|
93
96
|
await this.renderText(email, templateHtml, sampleData, flags.json);
|
|
94
97
|
return;
|
|
@@ -123,9 +126,14 @@ export default class Preview extends BaseCommand {
|
|
|
123
126
|
* Calls the API to send a test email to the specified address.
|
|
124
127
|
* Before domain verification, tests send via the mailmodo.com domain.
|
|
125
128
|
*/
|
|
126
|
-
async sendTestEmail(
|
|
129
|
+
async sendTestEmail(email, html, domain, toAddress, jsonOutput) {
|
|
127
130
|
await this.ensureAuth();
|
|
128
|
-
const response = await this.withApiSpinner({ json: jsonOutput, text: ' Sending test email...' }, () => this.apiClient.post(`${API_ENDPOINTS.PREVIEW}
|
|
131
|
+
const response = await this.withApiSpinner({ json: jsonOutput, text: ' Sending test email...' }, () => this.apiClient.post(`${API_ENDPOINTS.PREVIEW}/send`, {
|
|
132
|
+
domain,
|
|
133
|
+
html,
|
|
134
|
+
subject: email.subject,
|
|
135
|
+
to: toAddress,
|
|
136
|
+
}));
|
|
129
137
|
if (!response.ok) {
|
|
130
138
|
this.handleApiError(response);
|
|
131
139
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -114,45 +114,6 @@
|
|
|
114
114
|
"index.js"
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
|
-
"deploy": {
|
|
118
|
-
"aliases": [],
|
|
119
|
-
"args": {},
|
|
120
|
-
"description": "Deploy email sequences and verify sending domain",
|
|
121
|
-
"examples": [
|
|
122
|
-
"<%= config.bin %> deploy",
|
|
123
|
-
"<%= config.bin %> deploy --yes"
|
|
124
|
-
],
|
|
125
|
-
"flags": {
|
|
126
|
-
"json": {
|
|
127
|
-
"description": "Output as JSON",
|
|
128
|
-
"name": "json",
|
|
129
|
-
"allowNo": false,
|
|
130
|
-
"type": "boolean"
|
|
131
|
-
},
|
|
132
|
-
"yes": {
|
|
133
|
-
"char": "y",
|
|
134
|
-
"description": "Skip confirmation prompts",
|
|
135
|
-
"name": "yes",
|
|
136
|
-
"allowNo": false,
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"hasDynamicHelp": false,
|
|
141
|
-
"hiddenAliases": [],
|
|
142
|
-
"id": "deploy",
|
|
143
|
-
"pluginAlias": "@mailmodo/cli",
|
|
144
|
-
"pluginName": "@mailmodo/cli",
|
|
145
|
-
"pluginType": "core",
|
|
146
|
-
"strict": true,
|
|
147
|
-
"enableJsonFlag": false,
|
|
148
|
-
"isESM": true,
|
|
149
|
-
"relativePath": [
|
|
150
|
-
"dist",
|
|
151
|
-
"commands",
|
|
152
|
-
"deploy",
|
|
153
|
-
"index.js"
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
117
|
"domain": {
|
|
157
118
|
"aliases": [],
|
|
158
119
|
"args": {},
|
|
@@ -257,6 +218,45 @@
|
|
|
257
218
|
"index.js"
|
|
258
219
|
]
|
|
259
220
|
},
|
|
221
|
+
"deploy": {
|
|
222
|
+
"aliases": [],
|
|
223
|
+
"args": {},
|
|
224
|
+
"description": "Deploy email sequences and verify sending domain",
|
|
225
|
+
"examples": [
|
|
226
|
+
"<%= config.bin %> deploy",
|
|
227
|
+
"<%= config.bin %> deploy --yes"
|
|
228
|
+
],
|
|
229
|
+
"flags": {
|
|
230
|
+
"json": {
|
|
231
|
+
"description": "Output as JSON",
|
|
232
|
+
"name": "json",
|
|
233
|
+
"allowNo": false,
|
|
234
|
+
"type": "boolean"
|
|
235
|
+
},
|
|
236
|
+
"yes": {
|
|
237
|
+
"char": "y",
|
|
238
|
+
"description": "Skip confirmation prompts",
|
|
239
|
+
"name": "yes",
|
|
240
|
+
"allowNo": false,
|
|
241
|
+
"type": "boolean"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"hasDynamicHelp": false,
|
|
245
|
+
"hiddenAliases": [],
|
|
246
|
+
"id": "deploy",
|
|
247
|
+
"pluginAlias": "@mailmodo/cli",
|
|
248
|
+
"pluginName": "@mailmodo/cli",
|
|
249
|
+
"pluginType": "core",
|
|
250
|
+
"strict": true,
|
|
251
|
+
"enableJsonFlag": false,
|
|
252
|
+
"isESM": true,
|
|
253
|
+
"relativePath": [
|
|
254
|
+
"dist",
|
|
255
|
+
"commands",
|
|
256
|
+
"deploy",
|
|
257
|
+
"index.js"
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
260
|
"emails": {
|
|
261
261
|
"aliases": [],
|
|
262
262
|
"args": {},
|
|
@@ -473,14 +473,19 @@
|
|
|
473
473
|
"index.js"
|
|
474
474
|
]
|
|
475
475
|
},
|
|
476
|
-
"
|
|
476
|
+
"preview": {
|
|
477
477
|
"aliases": [],
|
|
478
|
-
"args": {
|
|
479
|
-
|
|
478
|
+
"args": {
|
|
479
|
+
"id": {
|
|
480
|
+
"description": "Email template ID to preview",
|
|
481
|
+
"name": "id"
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
"description": "Preview an email in browser, as text, or send a test",
|
|
480
485
|
"examples": [
|
|
481
|
-
"<%= config.bin %>
|
|
482
|
-
"<%= config.bin %>
|
|
483
|
-
"<%= config.bin %>
|
|
486
|
+
"<%= config.bin %> preview welcome",
|
|
487
|
+
"<%= config.bin %> preview welcome --text",
|
|
488
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
484
489
|
],
|
|
485
490
|
"flags": {
|
|
486
491
|
"json": {
|
|
@@ -496,17 +501,23 @@
|
|
|
496
501
|
"allowNo": false,
|
|
497
502
|
"type": "boolean"
|
|
498
503
|
},
|
|
499
|
-
"
|
|
500
|
-
"description": "
|
|
501
|
-
"name": "
|
|
504
|
+
"send": {
|
|
505
|
+
"description": "Send test email to this address",
|
|
506
|
+
"name": "send",
|
|
502
507
|
"hasDynamicHelp": false,
|
|
503
508
|
"multiple": false,
|
|
504
509
|
"type": "option"
|
|
510
|
+
},
|
|
511
|
+
"text": {
|
|
512
|
+
"description": "Output plain text version (for AI agents)",
|
|
513
|
+
"name": "text",
|
|
514
|
+
"allowNo": false,
|
|
515
|
+
"type": "boolean"
|
|
505
516
|
}
|
|
506
517
|
},
|
|
507
518
|
"hasDynamicHelp": false,
|
|
508
519
|
"hiddenAliases": [],
|
|
509
|
-
"id": "
|
|
520
|
+
"id": "preview",
|
|
510
521
|
"pluginAlias": "@mailmodo/cli",
|
|
511
522
|
"pluginName": "@mailmodo/cli",
|
|
512
523
|
"pluginType": "core",
|
|
@@ -516,23 +527,18 @@
|
|
|
516
527
|
"relativePath": [
|
|
517
528
|
"dist",
|
|
518
529
|
"commands",
|
|
519
|
-
"
|
|
530
|
+
"preview",
|
|
520
531
|
"index.js"
|
|
521
532
|
]
|
|
522
533
|
},
|
|
523
|
-
"
|
|
534
|
+
"settings": {
|
|
524
535
|
"aliases": [],
|
|
525
|
-
"args": {
|
|
526
|
-
|
|
527
|
-
"description": "Email template ID to preview",
|
|
528
|
-
"name": "id"
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
"description": "Preview an email in browser, as text, or send a test",
|
|
536
|
+
"args": {},
|
|
537
|
+
"description": "View and update project settings",
|
|
532
538
|
"examples": [
|
|
533
|
-
"<%= config.bin %>
|
|
534
|
-
"<%= config.bin %>
|
|
535
|
-
"<%= config.bin %>
|
|
539
|
+
"<%= config.bin %> settings",
|
|
540
|
+
"<%= config.bin %> settings --set brand_color=#0F3460",
|
|
541
|
+
"<%= config.bin %> settings --json"
|
|
536
542
|
],
|
|
537
543
|
"flags": {
|
|
538
544
|
"json": {
|
|
@@ -548,23 +554,17 @@
|
|
|
548
554
|
"allowNo": false,
|
|
549
555
|
"type": "boolean"
|
|
550
556
|
},
|
|
551
|
-
"
|
|
552
|
-
"description": "
|
|
553
|
-
"name": "
|
|
557
|
+
"set": {
|
|
558
|
+
"description": "Set a setting (format: key=value)",
|
|
559
|
+
"name": "set",
|
|
554
560
|
"hasDynamicHelp": false,
|
|
555
561
|
"multiple": false,
|
|
556
562
|
"type": "option"
|
|
557
|
-
},
|
|
558
|
-
"text": {
|
|
559
|
-
"description": "Output plain text version (for AI agents)",
|
|
560
|
-
"name": "text",
|
|
561
|
-
"allowNo": false,
|
|
562
|
-
"type": "boolean"
|
|
563
563
|
}
|
|
564
564
|
},
|
|
565
565
|
"hasDynamicHelp": false,
|
|
566
566
|
"hiddenAliases": [],
|
|
567
|
-
"id": "
|
|
567
|
+
"id": "settings",
|
|
568
568
|
"pluginAlias": "@mailmodo/cli",
|
|
569
569
|
"pluginName": "@mailmodo/cli",
|
|
570
570
|
"pluginType": "core",
|
|
@@ -574,7 +574,7 @@
|
|
|
574
574
|
"relativePath": [
|
|
575
575
|
"dist",
|
|
576
576
|
"commands",
|
|
577
|
-
"
|
|
577
|
+
"settings",
|
|
578
578
|
"index.js"
|
|
579
579
|
]
|
|
580
580
|
},
|
|
@@ -618,5 +618,5 @@
|
|
|
618
618
|
]
|
|
619
619
|
}
|
|
620
620
|
},
|
|
621
|
-
"version": "0.0.19-beta.pr21.
|
|
621
|
+
"version": "0.0.19-beta.pr21.31"
|
|
622
622
|
}
|
package/package.json
CHANGED