48hr.email/infrastructure/web/views/mail.twig

60 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-11-01 11:48:19 +01:00
{% extends 'layout.twig' %}
{% block body %}
<div style="float: right; text-align: end;">
2023-11-03 06:11:17 +01:00
<a href="/inbox/{{ address }}">
2023-11-01 11:48:19 +01:00
← Return to inbox</a>
<br>
2024-09-28 00:31:44 +02:00
<a href="/inbox/{{ address }}/{{ uid }}/delete">
2023-11-02 06:25:22 +01:00
Delete Email</a>
<br>
2024-09-28 01:49:37 +02:00
<a href="/inbox/{{ address }}/{{ uid }}/raw" target="_blank">
View Raw</a>
<br>
2023-11-03 06:11:17 +01:00
<a href="/logout">
2023-11-01 11:48:19 +01:00
Logout</a>
</div>
<hr>
2024-09-28 01:49:06 +02:00
<div class="mail_body" style="padding-left:10%;">
<h1 style="text-align:left;">
{{ mail.subject }}
<span style="float:right; padding-right:10vw;" >
From: {{ mail.from.text }} at {{ mail.date| date }}
</span>
</p>
2023-11-01 11:48:19 +01:00
</div>
{% if mail.html %}
<div>
2023-11-02 08:15:11 +01:00
{# TODO:
Find a better solution for this monstrocity.
Replaces clean html tag with styled one for readabbility.
Realistically, the entire iFrame or even website itself might be vulnerable.
srcdoc='html' seems like a very, very unsafe method to me, unfortunately I havent found a better solution.
#}
2023-11-02 12:05:01 +01:00
<iframe sandbox="allow-popups allow-popups-to-escape-sandbox" csp="script-src 'none'" srcdoc='{{ mail.html|replace({'<html>': '<html style="color: white"'}) }}'></iframe>
2023-11-01 11:48:19 +01:00
</div>
{% elseif mail.textAsHtml %}
2024-09-28 01:05:05 +02:00
<div class="mail_body">
2024-09-28 01:07:22 +02:00
{{ mail.textAsHtml|raw }}
2023-11-01 11:48:19 +01:00
</div>
{% else %}
<div class="mail_body"></div>
{% endif %}
2024-09-28 01:05:18 +02:00
{% if mail.attachments %}
2024-09-28 01:49:37 +02:00
<div class="mail_attachments">
2024-09-28 01:05:18 +02:00
{% for attachment in mail.attachments %}
<a href="">📎 {{ attachment.filename }}</a>
{#
Add actual button to download each file, inline.
Or even better. just an a href with filename.
very basic, like regular links look. maybe a paperclip icon
#}
{% endfor %}
</div>
{% endif %}
2023-11-01 11:48:19 +01:00
{% endblock %}