Skip to content

Commit d148c11

Browse files
authored
Merge pull request #153 from buggregator/issue/#152-fix-smpt-event-processed-data
Issue/#152 fix smpt event processed data
2 parents b18f37d + 0f221f4 commit d148c11

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/entities/smtp/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ export interface SMTPUser {
77

88
export interface SMTP {
99
id: string,
10-
from: SMTPUser[],
11-
reply_to: SMTPUser[],
10+
from?: SMTPUser[],
11+
reply_to?: SMTPUser[],
1212
subject: string,
13-
to: SMTPUser[],
14-
cc: SMTPUser[],
15-
bcc: SMTPUser[],
13+
to?: SMTPUser[],
14+
cc?: SMTPUser[],
15+
bcc?: SMTPUser[],
1616
text: string,
1717
html: string,
1818
raw: string,

src/entities/smtp/ui/preview-card/preview-card.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const props = defineProps<Props>();
1414
const dateFormat = computed(() => moment(props.event.date).fromNow());
1515
1616
const eventLink = computed(() => `/smtp/${props.event.id}`);
17+
18+
const emailRecipient = computed(
19+
() => props?.event?.payload?.to?.[0]?.email || null
20+
);
1721
</script>
1822

1923
<template>
@@ -24,7 +28,9 @@ const eventLink = computed(() => `/smtp/${props.event.id}`);
2428
</h3>
2529

2630
<div class="smtp-preview__link-text">
27-
<span><strong>To:</strong> {{ event.payload.to[0].email }} </span>
31+
<span v-if="emailRecipient"
32+
><strong>To:</strong> {{ emailRecipient }}
33+
</span>
2834

2935
<span>{{ dateFormat }}</span>
3036
</div>

0 commit comments

Comments
 (0)