Skip to content

Instantly share code, notes, and snippets.

@avm99963
Created July 9, 2021 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avm99963/14f81a255c6f8192c7cb420bfd86fd21 to your computer and use it in GitHub Desktop.
Save avm99963/14f81a255c6f8192c7cb420bfd86fd21 to your computer and use it in GitHub Desktop.
rss2email template which mimics FeedBurner

This gist contains a template for rss2email which mimics the Feedburner notification emails, since the Feedburner email notification service is being deprecated.

You can use email.tmpl directly with rss2email (read this), and feedburner_template.html is provided as the source file which has been encoded to a quoted printable version (which is not as readable) to create email.tmpl, so you can play directly with the feedburner_template.html file and change its contents to test several modifications, and then encode it to include it in the template file.

{{/* This is a template for rss2email (https://github.com/skx/rss2email) which
mimics the Feedburner notification emails (with some small changes).
*/ -}}
Content-Type: multipart/mixed; boundary=21ee3da964c7bf70def62adb9ee1a061747003c026e363e47231258c48f1
From: {{.From}}
To: {{.To}}
Subject: [{{.FeedTitle}}] {{.Subject}}
X-RSS-Link: {{.Link}}
X-RSS-Feed: {{.Feed}}
X-RSS-GUID: {{.RSSItem.GUID}}
Mime-Version: 1.0
--21ee3da964c7bf70def62adb9ee1a061747003c026e363e47231258c48f1
Content-Type: multipart/related; boundary=76a1282373c08a65dd49db1dea2c55111fda9a715c89720a844fabb7d497
--76a1282373c08a65dd49db1dea2c55111fda9a715c89720a844fabb7d497
Content-Type: multipart/alternative; boundary=4186c39e13b2140c88094b3933206336f2bb3948db7ecf064c7a7d7473f2
--4186c39e13b2140c88094b3933206336f2bb3948db7ecf064c7a7d7473f2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
{{quoteprintable .Link}}
{{.Text}}
{{quoteprintable .Link}}
--4186c39e13b2140c88094b3933206336f2bb3948db7ecf064c7a7d7473f2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html>=0A<html>=0A=0A<head>=0A <META http-equiv=3D"Content-Type=
" content=3D"text/html; charset=3DUTF-8">=0A <title>
{{.Subject}}
-
{{.FeedTitle}}
</title>=0A=0A <style type=3D"text/css">=0A h1 a:hover {=0A =
background-color: #888;=0A color: #fff !important;=0A =
}=0A=0A h1#feed-title {=0A margin: 3px;=0A =
padding-bottom: 6px;=0A }=0A=0A h1#feed-title a {=0A =
color: #888;=0A font-size: 22px;=0A font-family: A=
rial, Helvetica, Sans-Serif;=0A font-weight: normal;=0A =
text-decoration: none !important;=0A }=0A=0A div#emailbody=
{=0A margin: 0 2em;=0A font-family: Georgia, Helveti=
ca, Arial, Sans-Serif;=0A line-height: 140%;=0A font-=
size: 13px;=0A color: #000000;=0A }=0A=0A div#emai=
lbody #itemcontentlist {=0A line-height: 1.4em;=0A ma=
rgin: 3px;=0A }=0A=0A div#emailbody #itemcontentlist #item-ti=
tle {=0A margin: calc(1em + 3px) 0 3px 0;=0A }=0A=0A =
div#emailbody #itemcontentlist #item-title a {=0A font-family=
: Arial, Helvetica, Sans-Serif;=0A font-size: 18px;=0A }=
=0A=0A div#emailbody #itemcontentlist #item-timestamp {=0A =
font-size: 13px;=0A color: #555;=0A margin: 7px 0 3=
px 0;=0A font-family: Georgia, Helvetica, Arial, Sans-Serif;=0A =
line-height: 140%;=0A font-size: 13px;=0A }=0A=
=0A div#emailbody #itemcontentlist div#message {=0A margi=
n: 0;=0A font-family: Georgia, Helvetica, Arial, Sans-Serif;=0A =
line-height: 140%;=0A font-size: 13px;=0A =
color: #000000;=0A }=0A=0A div#emailbody #itemcontentlist div=
#message ul {=0A list-style-type: square;=0A padding-=
left: 1em;=0A }=0A=0A div#emailbody #itemcontentlist div#mess=
age blockquote {=0A padding-left: 6px;=0A border-left=
: 6px solid #dadada;=0A margin-left: 1em;=0A }=0A=0A =
div#emailbody #itemcontentlist div#message li {=0A margin-bot=
tom: 1em;=0A margin-left: 1em;=0A }=0A=0A #itemcon=
tentlist a:link,=0A #itemcontentlist a:visited,=0A #itemconte=
ntlist a:active {=0A color: #000099;=0A font-weight: =
bold;=0A }=0A=0A #footer {=0A border-top: 1px soli=
d #999;=0A padding-top: 7px;=0A margin-top: 1.5em;=0A=
width: 100%;=0A }=0A=0A #footer #footer-1 {=0A =
font-family: Helvetica, Arial, Sans-Serif;=0A font-size=
: 11px;=0A margin: 0 6px 1.2em 0;=0A color: #333;=0A =
}=0A=0A #footer #footer-2 {=0A float: right;=0A =
font-family: Helvetica, Arial, Sans-Serif;=0A font-size=
: 11px;=0A margin: 0 6px 1.2em 0;=0A color: #333;=0A =
}=0A=0A img {=0A border: none;=0A }=0A <=
/style>=0A</head>=0A=0A<body>=0A <div id=3D"emailbody">=0A <h1 id=
=3D"feed-title">
<a href=3D"{{quoteprintable .Feed}}">{{quoteprintable .FeedTitle}}</a></h1>
<hr style=3D"border: 1px solid #ccc; padding: 0; margin: 0;">=0A <di=
v id=3D"itemcontentlist">=0A <p id=3D"item-title">
<a name=3D"1" href=3D"{{quoteprintable .Link}}">{{quoteprintable .Subject}}
</a></p>=0A <p id=3D"item-timestamp"><span>Posted:</span>=20
{{quoteprintable .RSSItem.Published}}
</p>=0A <div id=3D"message">
{{.HTML}}
</div>=0A </div>=0A <div id=3D"footer">=0A <div id=
=3D"footer-2">Email delivery powered by <a href=3D"https://github.com/skx/r=
ss2email">rss2email</a></div>=0A <div id=3D"footer-1">You are su=
bscribed to email updates from=20
<a href=3D"{{quoteprintable .Feed}}">{{quoteprintable .FeedTitle}}</a>.
</div>=0A </div>=0A </div>=0A</body>=0A=0A</html>
--4186c39e13b2140c88094b3933206336f2bb3948db7ecf064c7a7d7473f2--
--76a1282373c08a65dd49db1dea2c55111fda9a715c89720a844fabb7d497--
--21ee3da964c7bf70def62adb9ee1a061747003c026e363e47231258c48f1--
<!DOCTYPE html>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{{.FeedTitle}}</title>
<style type="text/css">
h1 a:hover {
background-color: #888;
color: #fff !important;
}
h1#feed-title {
margin: 3px;
padding-bottom: 6px;
}
h1#feed-title a {
color: #888;
font-size: 22px;
font-family: Arial, Helvetica, Sans-Serif;
font-weight: normal;
text-decoration: none !important;
}
div#emailbody {
margin: 0 2em;
font-family: Georgia, Helvetica, Arial, Sans-Serif;
line-height: 140%;
font-size: 13px;
color: #000000;
}
div#emailbody #itemcontentlist {
line-height: 1.4em;
margin: 3px;
}
div#emailbody #itemcontentlist #item-title {
margin: calc(1em + 3px) 0 3px 0;
}
div#emailbody #itemcontentlist #item-title a {
font-family: Arial, Helvetica, Sans-Serif;
font-size: 18px;
}
div#emailbody #itemcontentlist #item-timestamp {
font-size: 13px;
color: #555;
margin: 7px 0 3px 0;
font-family: Georgia, Helvetica, Arial, Sans-Serif;
line-height: 140%;
font-size: 13px;
}
div#emailbody #itemcontentlist div#message {
margin: 0;
font-family: Georgia, Helvetica, Arial, Sans-Serif;
line-height: 140%;
font-size: 13px;
color: #000000;
}
div#emailbody #itemcontentlist div#message ul {
list-style-type: square;
padding-left: 1em;
}
div#emailbody #itemcontentlist div#message blockquote {
padding-left: 6px;
border-left: 6px solid #dadada;
margin-left: 1em;
}
div#emailbody #itemcontentlist div#message li {
margin-bottom: 1em;
margin-left: 1em;
}
#itemcontentlist a:link,
#itemcontentlist a:visited,
#itemcontentlist a:active {
color: #000099;
font-weight: bold;
}
#footer {
border-top: 1px solid #999;
padding-top: 7px;
margin-top: 1.5em;
width: 100%;
}
#footer #footer-1 {
font-family: Helvetica, Arial, Sans-Serif;
font-size: 11px;
margin: 0 6px 1.2em 0;
color: #333;
}
#footer #footer-2 {
float: right;
font-family: Helvetica, Arial, Sans-Serif;
font-size: 11px;
margin: 0 6px 1.2em 0;
color: #333;
}
img {
border: none;
}
</style>
</head>
<body>
<div id="emailbody">
<h1 id="feed-title"><a href="{{quoteprintable .Feed}}">
{{quoteprintable .FeedTitle}}</a></h1>
<hr style="border: 1px solid #ccc; padding: 0; margin: 0;">
<div id="itemcontentlist">
<p id="item-title">
<a name="1" href="{{quoteprintable .Link}}">
{{quoteprintable .Subject}}</a>
</p>
<p id="item-timestamp">
<span>Posted:</span>
{{quoteprintable .RSSItem.Published}}
</p>
<div id="message">
{{.Text}}
</div>
</div>
<div id="footer">
<div id="footer-2">
Email delivery powered by
<a href="https://github.com/skx/rss2email">rss2email</a>
</div>
<div id="footer-1">
You are subscribed to email updates from
<a href="{{quoteprintable .Feed}}">
{{quoteprintable .FeedTitle}}
</a>.
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment