Skip to content

Commit fc120c1

Browse files
committed
Add @img suffix to cid values
Turns out this is required to be spec-compliant. I don't think this was why things broke in my tests, but it is good to be comlpiant.
1 parent ab9bb5f commit fc120c1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pgweb/news/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def render_news_template(news):
4141
'contenttype': '{}; name={}'.format(_get_contenttype_from_extension(f), f),
4242
'filename': f,
4343
'disposition': 'inline; filename="{}"'.format(f),
44-
'id': '<{}>'.format(f),
44+
'id': '<{}@img>'.format(f),
4545
}
4646
with open(os.path.join(basedir, f), "rb") as f:
4747
a['content'] = f.read()

templates/news/mail/pgproject.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
{%block content%}
66
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="width: 100%;">
77
<tr>
8-
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo"></td>
8+
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png@img" alt="PostgreSQL logo"></td>
99
<td style="text-align: center;"><h1>{{news.title}}</h1></td>
10-
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo"></td>
10+
<td><img style="width: 50px; height: 50px;" height="50" width="50" src="cid:slonik.png@img" alt="PostgreSQL logo"></td>
1111
</tr>
1212
</table>
1313
{{news.content|markdown}}

0 commit comments

Comments
 (0)