mirror of
https://github.com/cytopia/devilbox.git
synced 2025-02-21 17:56:44 +00:00
fix: show utf-8 mail body properly
This commit is contained in:
parent
23a6aed10d
commit
bfb4769e85
@ -4,8 +4,9 @@ class HtmlEmail extends HTMLElement {
|
|||||||
this.attachShadow({ mode: 'open' });
|
this.attachShadow({ mode: 'open' });
|
||||||
|
|
||||||
let emailContent;
|
let emailContent;
|
||||||
|
const templateId = this.dataset.templateId;
|
||||||
try {
|
try {
|
||||||
emailContent = window.atob(this.dataset.content);
|
emailContent = document.getElementById(templateId).innerHTML;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return;
|
return;
|
||||||
|
@ -186,8 +186,8 @@ $messages = $MyMbox->get($sortOrderArr);
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
<?php if ($body !== null): ?>
|
<?php if ($body !== null): ?>
|
||||||
<html-email data-content="<?php echo base64_encode($body) ?>">
|
<template id="mail-body-<?=$data['num']?>"><?=$body?></template>
|
||||||
</html-email>
|
<html-email data-template-id="mail-body-<?=$data['num']?>"></html-email>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
No valid body found
|
No valid body found
|
||||||
@ -213,12 +213,9 @@ $messages = $MyMbox->get($sortOrderArr);
|
|||||||
<?php echo loadClass('Html')->getFooter(); ?>
|
<?php echo loadClass('Html')->getFooter(); ?>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$('.subject').each(function() {
|
$('.subject').click(function() {
|
||||||
$(this).click(function() {
|
var id = ($(this).attr('id'));
|
||||||
var id = ($(this).attr('id'));
|
$('#mail-'+id).toggle();
|
||||||
$('#mail-'+id).toggle();
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
// Handler for .ready() called.
|
// Handler for .ready() called.
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user