Skip to content

Commit

Permalink
Merge pull request #75 from parameter1/revert-74-stealth
Browse files Browse the repository at this point in the history
Revert "Remove stealth link from all newsletters"
  • Loading branch information
B77Mills authored May 28, 2024
2 parents 5c64e7d + fb054de commit 71eb358
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/common/components/blocks/body-wrapper.marko
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import moment from "moment";
$ const { newsletter, date } = input;

$ const unixTimestamp = moment(date).unix();
$ const stealthLinkUrl = `${newsletter.site.origin}/email-preview/${newsletter.id}/${unixTimestamp}`;

<table role="presentation" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
Expand All @@ -27,10 +28,14 @@ $ const unixTimestamp = moment(date).unix();
<common-header-block date=date newsletter=newsletter />
</else>

<common-stealth-link-element link-text=newsletter.site.name link-url=`${stealthLinkUrl}/top` />

<if(input.body)>
<${input.body} />
</if>

<common-stealth-link-element link-text=newsletter.site.name link-url=`${stealthLinkUrl}/bottom` />

<!-- Footer block -->
<if(input.footer)>
<${input.footer} />
Expand Down
13 changes: 13 additions & 0 deletions packages/common/components/blocks/footer.marko
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ $ const taglineStyle = {
"padding-top": "5px",
}

$ const stealthLinkStyle = {
"color": "#ffffff",
"display": "none",
"visibility": "hidden",
"mso-hide": "all",
"font-size": "1px",
"line-height": "1px",
"max-height": "0px",
"max-width": "0px",
"opacity": "0",
"overflow": "hidden",
}

<tr>
<td align="center" valign="top">
<table role="presentation" width="100%" border="0" bgcolor="#2f3031" align="center" cellpadding="0" cellspacing="0">
Expand Down
13 changes: 13 additions & 0 deletions packages/common/components/blocks/new-footer.marko
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ $ const taglineStyle = {
"padding-top": "5px",
}

$ const stealthLinkStyle = {
"color": "#ffffff",
"display": "none",
"visibility": "hidden",
"mso-hide": "all",
"font-size": "1px",
"line-height": "1px",
"max-height": "0px",
"max-width": "0px",
"opacity": "0",
"overflow": "hidden",
}

<tr>
<td align="center" valign="top">
<table role="presentation" width="100%" border="0" bgcolor="#2f3031" align="center" cellpadding="0" cellspacing="0">
Expand Down
11 changes: 11 additions & 0 deletions packages/common/components/elements/marko.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,16 @@
},
"<common-table-spacer-element>": {
"template": "./table-spacer.marko"
},
"<common-stealth-link-element>": {
"template": "./stealth-link.marko",
"@link-text": {
"type": "string",
"required": true
},
"@link-url": {
"type": "string",
"required": true
}
}
}
5 changes: 5 additions & 0 deletions packages/common/components/elements/stealth-link.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ const { linkText, linkUrl } = input;

<div name="divPreviewLink" style="display:none;height:0px;width:0px;overflow:hidden;visibility:hidden;mso-hide:all">
<a href=linkUrl>${linkText}</a>
</div>

0 comments on commit 71eb358

Please sign in to comment.