|
141 | 141 | </div>
|
142 | 142 | {% if message.htmlBody is defined %}
|
143 | 143 | {# Email instance #}
|
144 |
| - <div class="tab"> |
145 |
| - <h3 class="tab-title">HTML preview</h3> |
146 |
| - <div class="tab-content"> |
147 |
| - <pre class="prewrap" style="max-height: 600px"> |
148 |
| - <iframe |
149 |
| - src="data:text/html;base64;charset=utf-8,{{ collector.base64Encode(message.htmlBody()) }}" |
150 |
| - style="height: 80vh;width: 100%;" |
151 |
| - > |
152 |
| - </iframe> |
153 |
| - </pre> |
| 144 | + {% set htmlBody = message.htmlBody() %} |
| 145 | + {% if htmlBody is not null %} |
| 146 | + <div class="tab"> |
| 147 | + <h3 class="tab-title">HTML Preview</h3> |
| 148 | + <div class="tab-content"> |
| 149 | + <pre class="prewrap" style="max-height: 600px"> |
| 150 | + <iframe |
| 151 | + src="data:text/html;charset=utf-8;base64,{{ collector.base64Encode(htmlBody) }}" |
| 152 | + style="height: 80vh;width: 100%;" |
| 153 | + > |
| 154 | + </iframe> |
| 155 | + </pre> |
| 156 | + </div> |
154 | 157 | </div>
|
155 |
| - </div> |
156 |
| - <div class="tab"> |
157 |
| - <h3 class="tab-title">HTML Content</h3> |
158 |
| - <div class="tab-content"> |
159 |
| - <pre class="prewrap" style="max-height: 600px"> |
160 |
| - {%- if message.htmlCharset() %} |
161 |
| - {{- message.htmlBody()|convert_encoding('UTF-8', message.htmlCharset()) }} |
162 |
| - {%- else %} |
163 |
| - {{- message.htmlBody() }} |
164 |
| - {%- endif -%} |
165 |
| - </pre> |
| 158 | + <div class="tab"> |
| 159 | + <h3 class="tab-title">HTML Content</h3> |
| 160 | + <div class="tab-content"> |
| 161 | + <pre class="prewrap" style="max-height: 600px"> |
| 162 | + {%- if message.htmlCharset() %} |
| 163 | + {{- htmlBody|convert_encoding('UTF-8', message.htmlCharset()) }} |
| 164 | + {%- else %} |
| 165 | + {{- htmlBody }} |
| 166 | + {%- endif -%} |
| 167 | + </pre> |
| 168 | + </div> |
166 | 169 | </div>
|
167 |
| - </div> |
168 |
| - <div class="tab"> |
169 |
| - <h3 class="tab-title">Text Content</h3> |
170 |
| - <div class="tab-content"> |
171 |
| - <pre class="prewrap" style="max-height: 600px"> |
172 |
| - {%- if message.textCharset() %} |
173 |
| - {{- message.textBody()|convert_encoding('UTF-8', message.textCharset()) }} |
174 |
| - {%- else %} |
175 |
| - {{- message.textBody() }} |
176 |
| - {%- endif -%} |
177 |
| - </pre> |
| 170 | + {% endif %} |
| 171 | + {% set textBody = message.textBody() %} |
| 172 | + {% if textBody is not null %} |
| 173 | + <div class="tab"> |
| 174 | + <h3 class="tab-title">Text Content</h3> |
| 175 | + <div class="tab-content"> |
| 176 | + <pre class="prewrap" style="max-height: 600px"> |
| 177 | + {%- if message.textCharset() %} |
| 178 | + {{- textBody|convert_encoding('UTF-8', message.textCharset()) }} |
| 179 | + {%- else %} |
| 180 | + {{- textBody }} |
| 181 | + {%- endif -%} |
| 182 | + </pre> |
| 183 | + </div> |
178 | 184 | </div>
|
179 |
| - </div> |
| 185 | + {% endif %} |
180 | 186 | {% for attachment in message.attachments %}
|
181 | 187 | <div class="tab">
|
182 | 188 | <h3 class="tab-title">Attachment #{{ loop.index }}</h3>
|
|
0 commit comments