Go-To Actions with transactions emails (#5728)

* feat: go-to actions for emails

* fix: comment

* fix: tsc without previewText

* fix: goToAction

* fix: link to original template

* fix: final comments
This commit is contained in:
Apoorv Mishra
2023-08-23 18:43:52 +05:30
committed by GitHub
parent e3ba87dcb0
commit 53c6c5599a
16 changed files with 200 additions and 63 deletions

View File

@@ -144,11 +144,14 @@ Open Document: ${teamUrl}${document.url}
unsubscribeUrl,
body,
}: Props) {
const link = `${teamUrl}${document.url}?ref=notification-email`;
const documentLink = `${teamUrl}${document.url}?ref=notification-email`;
const eventName = this.eventName(eventType);
return (
<EmailTemplate>
<EmailTemplate
previewText={this.preview({ actorName, eventType } as Props)}
goToAction={{ url: documentLink, name: "View Document" }}
>
<Header />
<Body>
@@ -157,8 +160,8 @@ Open Document: ${teamUrl}${document.url}
</Heading>
<p>
{actorName} {eventName} the document{" "}
<a href={link}>{document.title}</a>, in the {collection.name}{" "}
collection.
<a href={documentLink}>{document.title}</a>, in the{" "}
{collection.name} collection.
</p>
{body && (
<>
@@ -170,7 +173,7 @@ Open Document: ${teamUrl}${document.url}
</>
)}
<p>
<Button href={link}>Open Document</Button>
<Button href={documentLink}>Open Document</Button>
</p>
</Body>