@aglyn/plugins-email 1.0.0-beta.221 → 1.0.0-beta.222

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.
Files changed (82) hide show
  1. package/README.md +5 -4
  2. package/package.json +16 -17
  3. package/src/lib/components/email-template-detail.d.ts +5 -13
  4. package/src/lib/components/email-template-detail.js +29 -426
  5. package/src/lib/components/email-template-detail.js.map +1 -1
  6. package/src/lib/components/email-zones.d.ts +15 -0
  7. package/src/lib/components/email-zones.js +1 -0
  8. package/src/lib/components/email-zones.js.map +1 -1
  9. package/src/lib/components/list-detail-card.d.ts +0 -36
  10. package/src/lib/components/list-detail-card.js +125 -84
  11. package/src/lib/components/list-detail-card.js.map +1 -1
  12. package/src/lib/components/list-members-panel.d.ts +17 -0
  13. package/src/lib/components/list-members-panel.js +14 -0
  14. package/src/lib/components/list-members-panel.js.map +1 -1
  15. package/src/lib/components/site-package-email-preview.d.ts +13 -0
  16. package/src/lib/components/site-package-email-preview.js +47 -0
  17. package/src/lib/components/site-package-email-preview.js.map +1 -0
  18. package/src/lib/components/suppressions-card.js +75 -6
  19. package/src/lib/components/suppressions-card.js.map +1 -1
  20. package/src/lib/components/use-org-email-topics.js +2 -9
  21. package/src/lib/components/use-org-email-topics.js.map +1 -1
  22. package/src/lib/constants/site-package.d.ts +21 -0
  23. package/src/lib/constants/site-package.js +21 -0
  24. package/src/lib/constants/site-package.js.map +1 -0
  25. package/src/lib/declarations.console-server.d.ts +12 -0
  26. package/src/lib/declarations.console-server.js +73 -0
  27. package/src/lib/declarations.console-server.js.map +1 -1
  28. package/src/lib/list-import.d.ts +64 -75
  29. package/src/lib/list-import.js +43 -158
  30. package/src/lib/list-import.js.map +1 -1
  31. package/src/lib/model/email-topic-catalog.d.ts +24 -0
  32. package/src/lib/model/email-topic-catalog.js +19 -0
  33. package/src/lib/model/email-topic-catalog.js.map +1 -1
  34. package/src/lib/model/index.d.ts +0 -25
  35. package/src/lib/model/index.js +0 -27
  36. package/src/lib/model/index.js.map +1 -1
  37. package/src/lib/plugin.d.ts +8 -0
  38. package/src/lib/plugin.js +76 -2
  39. package/src/lib/plugin.js.map +1 -1
  40. package/src/lib/server/person-eraser.d.ts +39 -0
  41. package/src/lib/server/person-eraser.js +44 -0
  42. package/src/lib/server/person-eraser.js.map +1 -0
  43. package/src/lib/server-console.js +9 -9
  44. package/src/lib/server-console.js.map +1 -1
  45. package/src/lib/server-list-gate.d.ts +7 -0
  46. package/src/lib/server-list-gate.js +10 -3
  47. package/src/lib/server-list-gate.js.map +1 -1
  48. package/src/lib/server-list-import.d.ts +20 -177
  49. package/src/lib/server-list-import.js +34 -594
  50. package/src/lib/server-list-import.js.map +1 -1
  51. package/src/lib/server.js +16 -29
  52. package/src/lib/server.js.map +1 -1
  53. package/src/lib/testing/stand-in-send-tally.d.ts +29 -0
  54. package/src/lib/testing/stand-in-send-tally.js +52 -0
  55. package/src/lib/testing/stand-in-send-tally.js.map +1 -0
  56. package/src/lib/transfer/email-transfer-catalog.d.ts +151 -0
  57. package/src/lib/transfer/email-transfer-catalog.js +536 -0
  58. package/src/lib/transfer/email-transfer-catalog.js.map +1 -0
  59. package/src/lib/transfer/list-import-steps.d.ts +44 -0
  60. package/src/lib/transfer/list-import-steps.js +201 -0
  61. package/src/lib/transfer/list-import-steps.js.map +1 -0
  62. package/src/lib/transfer/list-members.server.d.ts +165 -0
  63. package/src/lib/transfer/list-members.server.js +911 -0
  64. package/src/lib/transfer/list-members.server.js.map +1 -0
  65. package/src/lib/transfer/suppressions.server.d.ts +69 -0
  66. package/src/lib/transfer/suppressions.server.js +282 -0
  67. package/src/lib/transfer/suppressions.server.js.map +1 -0
  68. package/src/lib/transfer/topics-package.d.ts +56 -0
  69. package/src/lib/transfer/topics-package.js +87 -0
  70. package/src/lib/transfer/topics-package.js.map +1 -0
  71. package/src/lib/transfer/topics-package.server.d.ts +33 -0
  72. package/src/lib/transfer/topics-package.server.js +171 -0
  73. package/src/lib/transfer/topics-package.server.js.map +1 -0
  74. package/src/lib/transfer/transfer-reads.server.d.ts +25 -0
  75. package/src/lib/transfer/transfer-reads.server.js +34 -0
  76. package/src/lib/transfer/transfer-reads.server.js.map +1 -0
  77. package/src/lib/components/list-import-drawer.d.ts +0 -22
  78. package/src/lib/components/list-import-drawer.js +0 -662
  79. package/src/lib/components/list-import-drawer.js.map +0 -1
  80. package/src/lib/model/template-report.d.ts +0 -158
  81. package/src/lib/model/template-report.js +0 -249
  82. package/src/lib/model/template-report.js.map +0 -1
@@ -15,45 +15,28 @@
15
15
  * limitations under the License.
16
16
  */ 'use client';
17
17
  import { _ as _extends } from "@swc/helpers/_/_extends";
18
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  import { buildRoute, PageHeaderRecord, pluginDocsHelp, Route } from "@aglyn/aglyn";
20
20
  import { artifactRenameListKeys } from "@aglyn/aglyn/app-utils/artifact-list-keys";
21
21
  import { ICON_VARIANT_BESIGNER } from "@aglyn/shared-data-enums";
22
- import { mdiBullhornOutline, mdiEyeOutline } from "@aglyn/shared-data-mdi";
23
22
  import { AppLink, CardDisplay, MdiIcon } from "@aglyn/shared-ui-jsx";
24
- import RowActionsMenu from "@aglyn/shared-ui-jsx/components/row-actions-menu.component";
25
- import { ScrollTable } from "@aglyn/shared-ui-jsx/components/scroll-table.component";
26
- import { useConsoleHostRoute, useFirestore, useFirestoreCollection, useFirestoreDoc, useOrgDataScope } from "@aglyn/tenant-feature-instance";
27
- import { Alert, Button, Chip, Divider, Stack, TableBody, TableCell, TableHead, TableRow, TextField, Typography } from "@mui/material";
28
- import { collection, doc, documentId, limit, orderBy, query, updateDoc, where } from "firebase/firestore";
29
- import { useRouter } from "next/navigation";
23
+ import { useConsoleHostRoute, useFirestore, useFirestoreDoc } from "@aglyn/tenant-feature-instance";
24
+ import { Alert, Button, Stack, TextField, Typography } from "@mui/material";
25
+ import { doc, updateDoc } from "firebase/firestore";
30
26
  import { Suspense, useMemo, useState } from "react";
31
27
  import { useSnackbar } from "@aglyn/shared-ui-snackstack";
32
- import { CAMPAIGN_SEND_CONTAINER_FIELD, campaignSendVisibleTo, orgCampaignSendsPath } from "@aglyn/shared-ui-email-campaigns/model/campaign-container";
33
- import { emailSendTimeMs } from "@aglyn/shared-ui-email-campaigns/model/email-record";
34
- import { campaignSendDisplay } from "@aglyn/shared-ui-email-campaigns/model/campaign-container";
35
28
  import { templateProvenance } from "../model/template-provenance.js";
36
- import { templateReport } from "../model/template-report.js";
37
29
  import EmailDesignPreview from "./email-design-preview.js";
38
- import { EMAIL_TEMPLATE_RECIPIENTS_ZONE } from "./email-zones.js";
39
- import { Figure, RateRow, Section } from "@aglyn/shared-ui-jsx/components/measured-figures.component";
30
+ import { EMAIL_TEMPLATE_RECIPIENTS_ZONE, EMAIL_TEMPLATE_REPORT_ZONE } from "./email-zones.js";
31
+ import { Section } from "@aglyn/shared-ui-jsx/components/measured-figures.component";
40
32
  import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot-context";
41
- import { pluginRecordHref } from "@aglyn/aglyn/plugin-manager/plugin-record-routes";
42
- /**
43
- * How many of a template's messages one read covers.
44
- *
45
- * A CEILING on the read, not a page size: the report is a single figure per
46
- * quantity, so there is nothing to page through. Past it every total is a
47
- * floor and the report says so — the same treatment `audienceSizeTruncated`
48
- * gets, and for the same reason.
49
- */ export const TEMPLATE_CAMPAIGN_CEILING = 100;
50
33
  const previewDocsHelp = pluginDocsHelp('designedEmails', {
51
34
  anchor: '#send-it',
52
35
  excerpt: 'The template as an inbox receives it, drawn by the same renderer the ' + 'send path uses. Merge tokens are left standing — a real send fills them ' + 'from each recipient.'
53
36
  });
54
37
  const templateDocsHelp = pluginDocsHelp('designedEmails', {
55
38
  anchor: '#send-it',
56
- excerpt: 'One email template: what it looks like, every message sent from it, ' + 'and what those messages did — each rate over the population it was ' + 'measured against.'
39
+ excerpt: 'One email template: its name, where it came from, and what it looks ' + 'like. The emails sent from it are reported beneath, by the plugin that ' + 'sends them.'
57
40
  });
58
41
  /**
59
42
  * ONE EMAIL TEMPLATE: what it looks like, and what it has done.
@@ -77,25 +60,17 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
77
60
  *
78
61
  * ## What this page reads
79
62
  *
80
- * The screen document, its published version, and the messages naming this
81
- * template — bounded at {@link TEMPLATE_CAMPAIGN_CEILING}. The recipients
82
- * table is its own card and its own request, so a reader who came for the
83
- * preview does not pay for the delivery-log query.
63
+ * The screen document and its published version. The messages sent from the
64
+ * template are a send's, and sends are the campaign owner's: this page hosts
65
+ * two zones that plugin fills — the report of what those messages did, and
66
+ * who received them — handing over the site, the template and this page's
67
+ * base path, and reads none of the sends itself (AGL-3080).
84
68
  */ export function EmailTemplateDetail(props) {
85
- var _ref, _ref1, _ref2, _ref3;
69
+ var _ref, _ref1, _ref2;
86
70
  const { hostId, screenId, basePath } = props;
87
71
  const { orgSlug, subdomain } = useConsoleHostRoute(hostId);
88
- /*
89
- * A campaign's page is another plugin's, so its address is asked for: the
90
- * owner publishes where a `campaign` is read and this page links there.
91
- * Null where nobody does, or before the console's URL has resolved.
92
- */ const campaignHref = (campaignId)=>orgSlug && subdomain ? pluginRecordHref('campaign', {
93
- orgSlug,
94
- host: subdomain
95
- }, campaignId) : null;
96
- const RecipientsZone = useConsoleWidgetSlot();
72
+ const Zone = useConsoleWidgetSlot();
97
73
  const firestore = useFirestore();
98
- const router = useRouter();
99
74
  const { enqueueSnackbar } = useSnackbar();
100
75
  /*==========================================
101
76
  * RENAMING THE DESIGN, on its own page.
@@ -151,110 +126,9 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
151
126
  screenId,
152
127
  versionId
153
128
  ]);
154
- /*
155
- * The messages sent from this template, ordered by DOCUMENT ID.
156
- *
157
- * Not by date, and that is forced rather than chosen: a sent message
158
- * carries `sentAt`, a scheduled one carries `sendAtMs`, and no writer
159
- * stamps a `createdAt` — so `orderBy` on either would not mis-sort this
160
- * list, it would DROP every message written by the other branch. Ordering
161
- * on the document id is the one ordering every message satisfies, and the
162
- * rows are sorted by date below over a window this component already holds.
163
- * The index the filters need is `visibleTo` + `templateScreenId`, declared
164
- * in `cloud/firebase-firestore.indexes.json`.
165
- *
166
- * One MORE than the ceiling, so truncation is a fact rather than a guess.
167
- *
168
- * The sends are the ORGANIZATION'S, each stamped with the one site it is
169
- * sent as. The `visibleTo` clause names this site: it keeps a sibling
170
- * site's sends of a same-id design out, and it is what makes the read
171
- * provable for a collaborator scoped to this site — the rules evaluate a
172
- * list per document, and an unfiltered one is refused whole. Nothing is
173
- * read until the site's org is known.
174
- */ const { orgId } = useOrgDataScope({
175
- hostId
176
- });
177
- const sendScope = useMemo(()=>campaignSendVisibleTo(hostId), [
178
- hostId
179
- ]);
180
- const { data: messageDocs } = useFirestoreCollection(()=>orgId ? query(collection(firestore, ...orgCampaignSendsPath(orgId)), where('visibleTo', 'array-contains-any', sendScope), where('templateScreenId', '==', screenId), orderBy(documentId()), limit(TEMPLATE_CAMPAIGN_CEILING + 1)) : null, [
181
- firestore,
182
- orgId,
183
- sendScope,
184
- screenId
185
- ], {
186
- idField: '$id'
187
- });
188
- const truncated = ((_ref = messageDocs == null ? void 0 : messageDocs.length) != null ? _ref : 0) > TEMPLATE_CAMPAIGN_CEILING;
189
- const messages = useMemo(()=>(messageDocs != null ? messageDocs : []).slice(0, TEMPLATE_CAMPAIGN_CEILING).map((message)=>{
190
- var _message_status, _message_status1, _message_audience;
191
- return _extends({
192
- campaignId: String(message.$id),
193
- subject: String(message.subject || 'Untitled email'),
194
- /*
195
- * A message that has not gone out has NO send time, and that is
196
- * what `null` means here — not "unknown". The report measures
197
- * engagement over sent messages only, so a scheduled one
198
- * contributes to the list below and to no figure above it.
199
- */ sentAtMs: String((_message_status = message.status) != null ? _message_status : '') === 'sent' ? emailSendTimeMs(message) || null : null,
200
- status: String((_message_status1 = message.status) != null ? _message_status1 : 'sent'),
201
- audience: String((_message_audience = message.audience) != null ? _message_audience : '')
202
- }, message.listId ? {
203
- listId: String(message.listId)
204
- } : {}, message.listName ? {
205
- listName: String(message.listName)
206
- } : {}, {
207
- stats: message.stats,
208
- scheduledForMs: emailSendTimeMs(message)
209
- }, message[CAMPAIGN_SEND_CONTAINER_FIELD] ? {
210
- emailCampaignId: String(message[CAMPAIGN_SEND_CONTAINER_FIELD])
211
- } : {});
212
- }), [
213
- messageDocs
214
- ]);
215
- const orderedMessages = useMemo(()=>[
216
- ...messages
217
- ].sort((a, b)=>b.scheduledForMs - a.scheduledForMs), [
218
- messages
219
- ]);
220
- const report = useMemo(()=>templateReport(messages, truncated), [
221
- messages,
222
- truncated
223
- ]);
224
129
  const provenance = useMemo(()=>templateProvenance(screen), [
225
130
  screen
226
131
  ]);
227
- const messageHref = (message)=>`${basePath}/messages/${message.campaignId}`;
228
- /**
229
- * What one message sent from this template can be opened into.
230
- *
231
- * Its own report, and the campaign that grouped it. The template is the page
232
- * the reader is standing on, so it is not offered a third time. A message
233
- * sent before campaigns existed belongs to no container, and the item says
234
- * so rather than vanishing.
235
- */ const messageActions = (message)=>[
236
- {
237
- key: 'details',
238
- label: 'Open report',
239
- icon: /*#__PURE__*/ _jsx(MdiIcon, {
240
- path: mdiEyeOutline.path,
241
- size: 0.8
242
- }),
243
- href: messageHref(message)
244
- },
245
- {
246
- key: 'campaign',
247
- label: 'Open its campaign',
248
- icon: /*#__PURE__*/ _jsx(MdiIcon, {
249
- path: mdiBullhornOutline.path,
250
- size: 0.8
251
- }),
252
- // The one href here that is not under this surface's own base path.
253
- href: message.emailCampaignId && campaignHref(message.emailCampaignId) || undefined,
254
- disabled: !message.emailCampaignId || !campaignHref(message.emailCampaignId),
255
- disabledReason: message.emailCampaignId ? 'This site’s console URL has not resolved yet' : 'Sent before campaigns grouped their emails, so it belongs to none'
256
- }
257
- ];
258
132
  const listUrl = `${basePath}/templates`;
259
133
  const besignerUrl = orgSlug && subdomain && versionId ? buildRoute(Route.SCREEN_BESIGNER, {
260
134
  orgSlug,
@@ -355,10 +229,6 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
355
229
  severity: provenance.warn ? 'warning' : 'info',
356
230
  children: provenance.note
357
231
  }) : null,
358
- report.caveats.map((caveat)=>/*#__PURE__*/ _jsx(Alert, {
359
- severity: "info",
360
- children: caveat.message
361
- }, caveat.id)),
362
232
  /*#__PURE__*/ _jsx(Section, {
363
233
  title: "Name",
364
234
  children: /*#__PURE__*/ _jsxs(Stack, {
@@ -371,7 +241,7 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
371
241
  /*#__PURE__*/ _jsx(TextField, {
372
242
  label: "Design name",
373
243
  size: "small",
374
- value: nameDraft != null ? nameDraft : String((_ref1 = screen == null ? void 0 : screen.displayName) != null ? _ref1 : ''),
244
+ value: nameDraft != null ? nameDraft : String((_ref = screen == null ? void 0 : screen.displayName) != null ? _ref : ''),
375
245
  onChange: (event)=>setNameDraft(event.target.value),
376
246
  sx: {
377
247
  minWidth: 280
@@ -386,289 +256,22 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
386
256
  })
387
257
  ]
388
258
  })
389
- }),
390
- /*#__PURE__*/ _jsx(Divider, {}),
391
- /*#__PURE__*/ _jsx(Section, {
392
- title: "Delivery",
393
- children: /*#__PURE__*/ _jsxs(Stack, {
394
- direction: "row",
395
- spacing: 4,
396
- useFlexGap: true,
397
- sx: {
398
- flexWrap: 'wrap'
399
- },
400
- children: [
401
- /*#__PURE__*/ _jsx(Figure, {
402
- label: "Emails",
403
- value: report.sentCampaigns,
404
- note: "sent from this template"
405
- }),
406
- /*#__PURE__*/ _jsx(Figure, {
407
- label: "Addressed",
408
- value: report.recipients,
409
- note: "after each send's cap"
410
- }),
411
- /*#__PURE__*/ _jsx(Figure, {
412
- label: "Sent",
413
- value: report.sent,
414
- note: "accepted by the provider"
415
- }),
416
- /*#__PURE__*/ _jsx(Figure, {
417
- label: "Delivered",
418
- value: report.delivered,
419
- note: "accepted by the receiving server"
420
- }),
421
- /*#__PURE__*/ _jsx(Figure, {
422
- label: "Bounced",
423
- value: report.bounced,
424
- note: "of sent"
425
- }),
426
- /*#__PURE__*/ _jsx(Figure, {
427
- label: "Marked as spam",
428
- value: report.complained,
429
- note: "of delivered"
430
- })
431
- ]
432
- })
433
- }),
434
- /*#__PURE__*/ _jsx(Divider, {}),
435
- /*#__PURE__*/ _jsx(Section, {
436
- title: "Engagement",
437
- children: /*#__PURE__*/ _jsxs(Stack, {
438
- direction: "row",
439
- spacing: 4,
440
- useFlexGap: true,
441
- sx: {
442
- flexWrap: 'wrap'
443
- },
444
- children: [
445
- /*#__PURE__*/ _jsx(Figure, {
446
- label: "Opens",
447
- value: report.opens,
448
- note: "every open, repeats included"
449
- }),
450
- /*#__PURE__*/ _jsx(Figure, {
451
- label: "Readers who opened",
452
- value: report.uniqueOpens,
453
- note: "distinct recipients"
454
- }),
455
- /*#__PURE__*/ _jsx(Figure, {
456
- label: "Clicks",
457
- value: report.clicks,
458
- note: "every click, repeats included"
459
- }),
460
- /*#__PURE__*/ _jsx(Figure, {
461
- label: "Readers who clicked",
462
- value: report.uniqueClicks,
463
- note: "distinct recipients"
464
- }),
465
- /*#__PURE__*/ _jsx(Figure, {
466
- label: "Unsubscribed",
467
- value: report.unsubscribes,
468
- note: "through these emails' links"
469
- })
470
- ]
471
- })
472
- }),
473
- /*#__PURE__*/ _jsx(Divider, {}),
474
- /*#__PURE__*/ _jsx(Section, {
475
- title: "Rates",
476
- children: /*#__PURE__*/ _jsxs(Stack, {
477
- spacing: 1,
478
- children: [
479
- /*#__PURE__*/ _jsx(RateRow, {
480
- label: "Delivery rate",
481
- rate: report.rates.delivery
482
- }),
483
- /*#__PURE__*/ _jsx(RateRow, {
484
- label: "Open rate",
485
- rate: report.rates.open
486
- }),
487
- /*#__PURE__*/ _jsx(RateRow, {
488
- label: "Click rate",
489
- rate: report.rates.click
490
- }),
491
- /*#__PURE__*/ _jsx(RateRow, {
492
- label: "Click-to-open rate",
493
- rate: report.rates.clickToOpen
494
- }),
495
- /*#__PURE__*/ _jsx(RateRow, {
496
- label: "Bounce rate",
497
- rate: report.rates.bounce
498
- }),
499
- /*#__PURE__*/ _jsx(RateRow, {
500
- label: "Complaint rate",
501
- rate: report.rates.complaint
502
- }),
503
- /*#__PURE__*/ _jsx(RateRow, {
504
- label: "Unsubscribe rate",
505
- rate: report.rates.unsubscribe
506
- })
507
- ]
508
- })
509
- }),
510
- /*#__PURE__*/ _jsx(Divider, {}),
511
- /*#__PURE__*/ _jsx(Section, {
512
- title: "Who this went to",
513
- children: report.audiences.length ? /*#__PURE__*/ _jsxs(_Fragment, {
514
- children: [
515
- /*#__PURE__*/ _jsxs(ScrollTable, {
516
- size: "small",
517
- children: [
518
- /*#__PURE__*/ _jsx(TableHead, {
519
- children: /*#__PURE__*/ _jsxs(TableRow, {
520
- children: [
521
- /*#__PURE__*/ _jsx(TableCell, {
522
- children: 'Audience'
523
- }),
524
- /*#__PURE__*/ _jsx(TableCell, {
525
- align: "right",
526
- children: 'Emails'
527
- }),
528
- /*#__PURE__*/ _jsx(TableCell, {
529
- align: "right",
530
- children: 'Addressed'
531
- })
532
- ]
533
- })
534
- }),
535
- /*#__PURE__*/ _jsx(TableBody, {
536
- children: report.audiences.map((audience)=>/*#__PURE__*/ _jsxs(TableRow, {
537
- children: [
538
- /*#__PURE__*/ _jsx(TableCell, {
539
- children: audience.label
540
- }),
541
- /*#__PURE__*/ _jsx(TableCell, {
542
- align: "right",
543
- children: audience.campaigns.toLocaleString()
544
- }),
545
- /*#__PURE__*/ _jsx(TableCell, {
546
- align: "right",
547
- sx: {
548
- fontWeight: 'bold'
549
- },
550
- children: audience.addressed.toLocaleString()
551
- })
552
- ]
553
- }, audience.id))
554
- })
555
- ]
556
- }),
557
- /*#__PURE__*/ _jsx(Typography, {
558
- variant: "caption",
559
- color: "text.secondary",
560
- children: 'Each list is named as it was when the email was sent, so ' + 'renaming or deleting a list does not rewrite what a past ' + 'send went to.'
561
- })
562
- ]
563
- }) : /*#__PURE__*/ _jsx(Typography, {
564
- variant: "body2",
565
- color: "text.secondary",
566
- children: 'No email sent from this template has gone out yet.'
567
- })
568
- }),
569
- orderedMessages.length ? /*#__PURE__*/ _jsxs(_Fragment, {
570
- children: [
571
- /*#__PURE__*/ _jsx(Divider, {}),
572
- /*#__PURE__*/ _jsx(Section, {
573
- title: "Emails using this template",
574
- children: /*#__PURE__*/ _jsxs(ScrollTable, {
575
- size: "small",
576
- children: [
577
- /*#__PURE__*/ _jsx(TableHead, {
578
- children: /*#__PURE__*/ _jsxs(TableRow, {
579
- children: [
580
- /*#__PURE__*/ _jsx(TableCell, {
581
- children: 'Subject'
582
- }),
583
- /*#__PURE__*/ _jsx(TableCell, {
584
- children: 'State'
585
- }),
586
- /*#__PURE__*/ _jsx(TableCell, {
587
- children: 'When'
588
- }),
589
- /*#__PURE__*/ _jsx(TableCell, {
590
- align: "right",
591
- children: 'Addressed'
592
- }),
593
- /*#__PURE__*/ _jsx(TableCell, {
594
- align: "right",
595
- children: 'Opens'
596
- }),
597
- /*#__PURE__*/ _jsx(TableCell, {
598
- align: "right",
599
- children: 'Clicks'
600
- }),
601
- /*#__PURE__*/ _jsx(TableCell, {
602
- align: "right"
603
- })
604
- ]
605
- })
606
- }),
607
- /*#__PURE__*/ _jsx(TableBody, {
608
- children: orderedMessages.map((message)=>{
609
- var _ref, _ref1, _ref2;
610
- var _message_stats, _message_stats1, _message_stats2;
611
- return /*#__PURE__*/ _jsxs(TableRow, {
612
- hover: true,
613
- onClick: ()=>router.push(messageHref(message)),
614
- sx: {
615
- cursor: 'pointer'
616
- },
617
- children: [
618
- /*#__PURE__*/ _jsx(TableCell, {
619
- children: /*#__PURE__*/ _jsx(AppLink, {
620
- href: messageHref(message),
621
- onClick: (event)=>event.stopPropagation(),
622
- children: message.subject
623
- })
624
- }),
625
- /*#__PURE__*/ _jsx(TableCell, {
626
- children: /*#__PURE__*/ _jsx(Chip, {
627
- size: "small",
628
- label: campaignSendDisplay(message).label
629
- })
630
- }),
631
- /*#__PURE__*/ _jsx(TableCell, {
632
- children: message.scheduledForMs ? new Date(message.scheduledForMs).toLocaleString() : '—'
633
- }),
634
- /*#__PURE__*/ _jsx(TableCell, {
635
- align: "right",
636
- children: Number((_ref = (_message_stats = message.stats) == null ? void 0 : _message_stats.recipients) != null ? _ref : 0).toLocaleString()
637
- }),
638
- /*#__PURE__*/ _jsx(TableCell, {
639
- align: "right",
640
- children: Number((_ref1 = (_message_stats1 = message.stats) == null ? void 0 : _message_stats1.opens) != null ? _ref1 : 0).toLocaleString()
641
- }),
642
- /*#__PURE__*/ _jsx(TableCell, {
643
- align: "right",
644
- children: Number((_ref2 = (_message_stats2 = message.stats) == null ? void 0 : _message_stats2.clicks) != null ? _ref2 : 0).toLocaleString()
645
- }),
646
- /*#__PURE__*/ _jsx(TableCell, {
647
- align: "right",
648
- sx: {
649
- width: 56
650
- },
651
- onClick: (event)=>event.stopPropagation(),
652
- children: /*#__PURE__*/ _jsx(RowActionsMenu, {
653
- label: String(message.subject),
654
- items: messageActions(message)
655
- })
656
- })
657
- ]
658
- }, message.campaignId);
659
- })
660
- })
661
- ]
662
- })
663
- })
664
- ]
665
- }) : null
259
+ })
666
260
  ]
667
261
  })
668
262
  }),
669
- RecipientsZone ? /*#__PURE__*/ _jsx(Suspense, {
263
+ Zone ? /*#__PURE__*/ _jsx(Suspense, {
264
+ fallback: null,
265
+ children: /*#__PURE__*/ _jsx(Zone, {
266
+ slot: EMAIL_TEMPLATE_REPORT_ZONE.id,
267
+ hostId: hostId,
268
+ screenId: screenId,
269
+ basePath: basePath
270
+ })
271
+ }) : null,
272
+ Zone ? /*#__PURE__*/ _jsx(Suspense, {
670
273
  fallback: null,
671
- children: /*#__PURE__*/ _jsx(RecipientsZone, {
274
+ children: /*#__PURE__*/ _jsx(Zone, {
672
275
  slot: EMAIL_TEMPLATE_RECIPIENTS_ZONE.id,
673
276
  hostId: hostId,
674
277
  screenId: screenId
@@ -683,8 +286,8 @@ const templateDocsHelp = pluginDocsHelp('designedEmails', {
683
286
  hostId: hostId,
684
287
  nodes: version == null ? void 0 : version.nodes,
685
288
  loading: version === undefined && Boolean(versionId),
686
- subject: String((_ref2 = screen == null ? void 0 : screen.emailSubject) != null ? _ref2 : ''),
687
- preheader: String((_ref3 = screen == null ? void 0 : screen.emailPreheader) != null ? _ref3 : ''),
289
+ subject: String((_ref1 = screen == null ? void 0 : screen.emailSubject) != null ? _ref1 : ''),
290
+ preheader: String((_ref2 = screen == null ? void 0 : screen.emailPreheader) != null ? _ref2 : ''),
688
291
  emptyMessage: 'This template has nothing in it yet. Open it in the ' + 'besigner to build the email.'
689
292
  })
690
293
  })