mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-01 02:26:40 +00:00
22 lines
461 B
JavaScript
22 lines
461 B
JavaScript
|
class HtmlEmail extends HTMLElement {
|
||
|
constructor() {
|
||
|
super();
|
||
|
this.attachShadow({ mode: 'open' });
|
||
|
|
||
|
let emailContent;
|
||
|
try {
|
||
|
emailContent = window.atob(this.dataset.content);
|
||
|
} catch (error) {
|
||
|
console.log(error);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
const container = document.createElement('div');
|
||
|
container.innerHTML = emailContent;
|
||
|
|
||
|
this.shadowRoot.appendChild(container);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
customElements.define('html-email', HtmlEmail);
|