PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.11.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.11.0
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
← All changes | app/Services/Libs/EmailComposer.php +14 -3 2.6.012.11.0 View file →
@@ -83,9 +83,9 @@
83 83 }
84 84
85 85 if ($block['type'] == 'boxed_content') {
86 86 return (string)App::make('view')->make('email.Default._user_box_content', [
87 - 'user_name' => $block['options']['user']->display_name,
87 + 'user_name' => $block['options']['user']->getPublicDisplayName(),
88 88 'user_avatar' => !(empty($block['options']['user']->xprofile->avatar)) ? $block['options']['user']->xprofile->avatar : $block['options']['user']->photo,
89 89 'content' => $block['content'],
90 90 'permalink' => $block['options']['permalink'],
91 91 'post_content' => $block['options']['post_content'],
@@ -94,9 +94,9 @@
94 94 }
95 95
96 96 if ($block['type'] == 'post_boxed_content') {
97 97 return (string)App::make('view')->make('email.Default._user_post_content', [
98 - 'user_name' => $block['options']['user']->display_name,
98 + 'user_name' => $block['options']['user']->getPublicDisplayName(),
99 99 'user_avatar' => !(empty($block['options']['user']->xprofile->avatar)) ? $block['options']['user']->xprofile->avatar : $block['options']['user']->photo,
100 100 'content' => $block['content'],
101 101 'title' => Arr::get($block['options'], 'title'),
102 102 'permalink' => $block['options']['permalink'],
@@ -220,8 +220,19 @@
220 220 if ($this->headingBlocks) {
221 221 $data['headingContent'] = $this->complileHeadingBlocks();
222 222 }
223 223
224 - return (string)App::make('view')->make('email.template', $data);
224 + $html = (string)App::make('view')->make('email.template', $data);
225 +
226 + // Inline the <head><style> rules onto each element so they survive clients and
227 + // log viewers that strip the document head (Outlook, FluentSMTP's DOMPurify
228 + // preview). @media/:hover rules can't be inlined and are kept in a <style> tag.
229 + try {
230 + $html = (new Emogrifier\Emogrifier($html))->emogrify();
231 + } catch (\Throwable $e) {
232 + // Fall back to the un-inlined HTML; the <head><style> still covers Gmail.
233 + }
234 +
235 + return $html;
225 236 }
226 237
227 238 }