Skip to content

Commit

Permalink
Merge pull request #153 from buggregator/issue/#152-fix-smpt-event-pr…
Browse files Browse the repository at this point in the history
…ocessed-data

Issue/#152 fix smpt event processed data
  • Loading branch information
butschster committed Jun 5, 2024
2 parents b18f37d + 0f221f4 commit d148c11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/entities/smtp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export interface SMTPUser {

export interface SMTP {
id: string,
from: SMTPUser[],
reply_to: SMTPUser[],
from?: SMTPUser[],
reply_to?: SMTPUser[],
subject: string,
to: SMTPUser[],
cc: SMTPUser[],
bcc: SMTPUser[],
to?: SMTPUser[],
cc?: SMTPUser[],
bcc?: SMTPUser[],
text: string,
html: string,
raw: string,
Expand Down
8 changes: 7 additions & 1 deletion src/entities/smtp/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const props = defineProps<Props>();
const dateFormat = computed(() => moment(props.event.date).fromNow());
const eventLink = computed(() => `/smtp/${props.event.id}`);
const emailRecipient = computed(
() => props?.event?.payload?.to?.[0]?.email || null
);
</script>

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

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

<span>{{ dateFormat }}</span>
</div>
Expand Down

0 comments on commit d148c11

Please sign in to comment.