From 88f74af0ad170a9d11385d44c4f5937fc9428260 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 28 Mar 2023 20:09:12 +0200 Subject: [PATCH] wip #5835 @2 --- app/Fluidbook/Packager/Download.php | 17 +- app/Jobs/DownloadBase.php | 14 +- app/Jobs/ElearningMediaDownload.php | 2 + app/Jobs/ElearningPackageDownload.php | 2 + app/Jobs/FluidbookCollectionDownload.php | 7 +- app/Jobs/QuizDownload.php | 3 + app/Jobs/Tools/FluidbookAssetsDownloader.php | 2 +- app/Notifications/DownloadReady.php | 26 +- public/images/logo-email.png | Bin 0 -> 5445 bytes .../views/vendor/mail/html/button.blade.php | 19 ++ .../views/vendor/mail/html/footer.blade.php | 11 + .../views/vendor/mail/html/header.blade.php | 11 + .../views/vendor/mail/html/layout.blade.php | 56 ++++ .../views/vendor/mail/html/message.blade.php | 27 ++ .../views/vendor/mail/html/panel.blade.php | 14 + .../views/vendor/mail/html/subcopy.blade.php | 7 + .../views/vendor/mail/html/table.blade.php | 3 + .../views/vendor/mail/html/themes/default.css | 296 ++++++++++++++++++ .../views/vendor/mail/text/button.blade.php | 1 + .../views/vendor/mail/text/footer.blade.php | 1 + .../views/vendor/mail/text/header.blade.php | 1 + .../views/vendor/mail/text/layout.blade.php | 9 + .../views/vendor/mail/text/message.blade.php | 27 ++ .../views/vendor/mail/text/panel.blade.php | 1 + .../views/vendor/mail/text/subcopy.blade.php | 1 + .../views/vendor/mail/text/table.blade.php | 1 + .../vendor/notifications/email.blade.php | 66 ++++ 27 files changed, 611 insertions(+), 14 deletions(-) create mode 100644 public/images/logo-email.png create mode 100644 resources/views/vendor/mail/html/button.blade.php create mode 100644 resources/views/vendor/mail/html/footer.blade.php create mode 100644 resources/views/vendor/mail/html/header.blade.php create mode 100644 resources/views/vendor/mail/html/layout.blade.php create mode 100644 resources/views/vendor/mail/html/message.blade.php create mode 100644 resources/views/vendor/mail/html/panel.blade.php create mode 100644 resources/views/vendor/mail/html/subcopy.blade.php create mode 100644 resources/views/vendor/mail/html/table.blade.php create mode 100644 resources/views/vendor/mail/html/themes/default.css create mode 100644 resources/views/vendor/mail/text/button.blade.php create mode 100644 resources/views/vendor/mail/text/footer.blade.php create mode 100644 resources/views/vendor/mail/text/header.blade.php create mode 100644 resources/views/vendor/mail/text/layout.blade.php create mode 100644 resources/views/vendor/mail/text/message.blade.php create mode 100644 resources/views/vendor/mail/text/panel.blade.php create mode 100644 resources/views/vendor/mail/text/subcopy.blade.php create mode 100644 resources/views/vendor/mail/text/table.blade.php create mode 100644 resources/views/vendor/notifications/email.blade.php diff --git a/app/Fluidbook/Packager/Download.php b/app/Fluidbook/Packager/Download.php index 281418ddf..02a7c71d4 100644 --- a/app/Fluidbook/Packager/Download.php +++ b/app/Fluidbook/Packager/Download.php @@ -22,6 +22,12 @@ class Download extends DownloadBase // __('Fluidbook ":title" (#:nb) installé sur :server') protected $_installSubject = 'Fluidbook ":title" (#:nb) installé sur :server'; + // __('Le Fluidbook ":title" est prêt au téléchargement.'); + protected $_text = 'Le Fluidbook ":title" est prêt au téléchargement.'; + + // __('Le Fluidbook ":title" a été installé sur :server.') + protected $_installText = 'Le Fluidbook ":title" a été installé sur :server.'; + protected $_params = []; public function __construct($entry, $version, $action, $user, $params = []) @@ -71,8 +77,10 @@ class Download extends DownloadBase { try { $url = $this->_compileandpackage(); - $subject = __($this->_subject, ['title' => $this->_title(), 'nb' => $this->_id()]); - $text = ''; + $translateVariables = ['title' => $this->_title(), 'nb' => $this->_id()]; + + $subject = __($this->_subject, $translateVariables); + $text = __($this->_text, $translateVariables); $actions = []; if ($this->action === 'download' || $this->action === 'scormcloud') { $actions = ['Télécharger' => $url]; @@ -97,7 +105,10 @@ class Download extends DownloadBase if (!$dest) { throw new \Exception('No path defined for external server installation'); } - $subject = __($this->_installSubject, ['title' => $this->_title(), 'nb' => $this->_id(), 'server' => $server->name]); + + $translateVariables['server'] = $server->name; + $subject = __($this->_installSubject, $translateVariables); + $text = __($this->_installText, $translateVariables); $path = $this->_compileandpackage(false); $driver = $server->getTransferDriver(); diff --git a/app/Jobs/DownloadBase.php b/app/Jobs/DownloadBase.php index 7150fb3bf..6f479df7e 100644 --- a/app/Jobs/DownloadBase.php +++ b/app/Jobs/DownloadBase.php @@ -37,6 +37,8 @@ class DownloadBase extends Base protected $_subject; + protected $_text; + /** * @param $entry CubistMagicAbstractModel * @param $action string @@ -123,9 +125,10 @@ class DownloadBase extends Base { try { $url = $this->_compileandpackage(); - $subject = __($this->_subject, ['title' => $this->_title(), 'nb' => $this->_id()]); - $text = ''; - $actions = ['Télécharger' => $url]; + $translateVariables = $this->_getTranslateVariables(); + $subject = __($this->_subject, $translateVariables); + $text = __($this->_text, $translateVariables); + $actions = [__('Télécharger') => $url]; try { if ($this->action === 'scormcloud') { $scormURL = ScormCloud::send($url, 'toolbox_' . $this->type . '_' . $this->_id()); @@ -143,6 +146,11 @@ class DownloadBase extends Base $this->sendNotification($subject, $text, $actions); } + protected function _getTranslateVariables() + { + return ['title' => $this->_title(), 'nb' => $this->_id()]; + } + protected function _compileandpackage() { diff --git a/app/Jobs/ElearningMediaDownload.php b/app/Jobs/ElearningMediaDownload.php index dea8bb12f..8d350e1ae 100644 --- a/app/Jobs/ElearningMediaDownload.php +++ b/app/Jobs/ElearningMediaDownload.php @@ -11,4 +11,6 @@ class ElearningMediaDownload extends DownloadBase protected $type = 'elearningmedia'; // __('Media ":title" (#:nb) prêt au téléchargement') protected $_subject = 'Media ":title" (#:nb) prêt au téléchargement'; + // __('Le media ":title" est prêt au téléchargement'); + protected $_text = 'Le media ":title" est prêt au téléchargement'; } diff --git a/app/Jobs/ElearningPackageDownload.php b/app/Jobs/ElearningPackageDownload.php index d4fbb5845..53a73876c 100644 --- a/app/Jobs/ElearningPackageDownload.php +++ b/app/Jobs/ElearningPackageDownload.php @@ -11,4 +11,6 @@ class ElearningPackageDownload extends DownloadBase protected $type = 'elearningpackage'; // __('Package ":title" (#:nb) prêt au téléchargement') protected $_subject = 'Package ":title" (#:nb) prêt au téléchargement'; + // __('Le package ":title" est prêt au téléchargement'); + protected $_text = 'Le package ":title" est prêt au téléchargement'; } diff --git a/app/Jobs/FluidbookCollectionDownload.php b/app/Jobs/FluidbookCollectionDownload.php index 76974023d..7bdb873d2 100644 --- a/app/Jobs/FluidbookCollectionDownload.php +++ b/app/Jobs/FluidbookCollectionDownload.php @@ -18,16 +18,19 @@ class FluidbookCollectionDownload extends DownloadBase // __('Collection ":title" (#:nb) prête au téléchargement') protected $_subject = 'Collection ":title" (#:nb) prête au téléchargement'; + // __('La collection ":title" est prêt au téléchargement'); + protected $_text = 'La collection ":title" est prêt au téléchargement'; public function handle() { + $translateVariables = $this->_getTranslateVariables(); if ($this->action === 'install') { $url = $this->installHosting($this->entry->getPageData()); - $this->sendNotification(__('Collection ":title" (#:nb) installée sur le serveur hosting', ['title' => $this->_title(), 'nb' => $this->_id()]), '', $url); + $this->sendNotification(__('Collection ":title" (#:nb) installée sur le serveur hosting', $translateVariables), '', $url); } else if ($this->action === 'export' && in_array($this->entry->version, ['win_inss_html', 'win_ins_html'])) { $url = $this->downloadList($this->entry->getPageData()); - $this->sendNotification(__('Collection ":title" (#:nb) prête au téléchargement', ['title' => $this->_title(), 'nb' => $this->_id()]), '', $url); + $this->sendNotification(__($this->_subject, $translateVariables), __($this->_text,$translateVariables), $url); } else { parent::handle(); } diff --git a/app/Jobs/QuizDownload.php b/app/Jobs/QuizDownload.php index 8489f1c2d..9d2ce2961 100644 --- a/app/Jobs/QuizDownload.php +++ b/app/Jobs/QuizDownload.php @@ -12,4 +12,7 @@ class QuizDownload extends DownloadBase protected $type = 'quiz'; // __('Quiz ":title" (#:nb) prêt au téléchargement') protected $_subject = 'Quiz ":title" (#:nb) prêt au téléchargement'; + // __('Le quiz ":title" est prêt au téléchargement') + protected $_text = 'Le quiz ":title" est prêt au téléchargement'; + } diff --git a/app/Jobs/Tools/FluidbookAssetsDownloader.php b/app/Jobs/Tools/FluidbookAssetsDownloader.php index 2454cc388..f6b47d97b 100644 --- a/app/Jobs/Tools/FluidbookAssetsDownloader.php +++ b/app/Jobs/Tools/FluidbookAssetsDownloader.php @@ -24,7 +24,7 @@ class FluidbookAssetsDownloader extends Base throw new \Exception('Fluidbook has not be set'); } $this->setJobName(__('Téléchargement massif d\'assets dans un fluidbook')); - $this->dest = '/application/protected/fluidbookpublication/working/' . $fluidbook . '/'; + $this->dest = Files::mkdir(protected_path('fluidbookpublication/working/' . $fluidbook)); if ($folder !== 'working') { $this->dest .= $folder . '/'; } diff --git a/app/Notifications/DownloadReady.php b/app/Notifications/DownloadReady.php index 444b46573..316587ded 100644 --- a/app/Notifications/DownloadReady.php +++ b/app/Notifications/DownloadReady.php @@ -6,6 +6,7 @@ use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; +use Illuminate\Support\HtmlString; class DownloadReady extends Notification { @@ -14,17 +15,19 @@ class DownloadReady extends Notification protected $subject; protected $text; protected $actions = []; + protected $error = false; /** * Create a new notification instance. * * @return void */ - public function __construct($subject = '', $text = '', $actions = []) + public function __construct($subject = '', $text = '', $actions = [], $error = false) { $this->subject = $subject; $this->text = $text; $this->actions = $actions; + $this->error = $error; } /** @@ -35,6 +38,7 @@ class DownloadReady extends Notification */ public function via($notifiable) { + return ['database', 'mail']; if ($notifiable->slack) { return ['database', FluidbookslackChannel::class]; } else { @@ -50,10 +54,22 @@ class DownloadReady extends Notification */ public function toMail($notifiable) { - return (new MailMessage) - ->line('The introduction to the notification.') - ->action('Notification Action', url('/')) - ->line('Thank you for using our application!'); + $m = (new MailMessage)->greeting(__('Bonjour !')) + ->subject($this->subject); + if ($this->text) { + $m->line($this->text); + } + foreach ($this->actions as $label => $url) { + $m->line(new HtmlString($label . __(': ') . ' ' . $url . '')); + } + $m->salutation(new HtmlString(__('Cordialement,') . "
" . __('L\'équipe Fluidbook'))); + if ($this->error) { + $m->error(); + } else { + $m->success(); + } + return $m; + } /** diff --git a/public/images/logo-email.png b/public/images/logo-email.png new file mode 100644 index 0000000000000000000000000000000000000000..07e2899908acdb688d16ff0c2722e43126064227 GIT binary patch literal 5445 zcmaJ_cT`j9w+*0l1nEr-ARPjUl!RW@P?cT;LP#W`1PGx?kt$7)77$d5fQUqTQFijMAXAcx-=ke{2!IU4{_R`c_4aCAWvfJn3x7N;VxS>G%G#G+ILEaVJi3_P^Z z80@Y4c(loVLsQ55E{-sifSM{$*-!CYzzt1s0Q$MP;=C07R0RIiRXiX6UX~UB{s|$t zs0jSWl%>IKpq4ux4TOPYq#R{rz(55U$WaC&Ba4Kf(Dx*P5E;mIX&K1*Ed_=sf@KvU zvcSJCf%AxX)ICLG?Hhl^JD;ftUcMQLeYUtf^#b&xyWNg51;!G3E%AX4WDDKCE< z!NE@o=Oy^Jf;QUA5s&pCVBK-R---@McW;7KoO4fA~@h2(Qs`QfpZBE7K>7Z z>VReB@tL^US?S{q?{^p|o%hmi>?(cqZ z^Ei*JjmBer(5M@DcQ@dlIV)oS-3#|J5cy|+TzwSHbe~=Y0xS8d(@lFBoC^%?e zf6e08$q*}MI3NCr?DOh!4a8 zQw1M@8ABOqb@AbzP0ZWk=YI__EcA2u+y1fuHzs2?$=Ysp+DG3BKzkSK_^HYTF zZX~i72^(a7qqGbKa7s;AUc74tJsvyYi^Y^XpC==2ZJFA}Th+8P`N>nt`rKf3X5Dy) z!a>2Nc7I`$mAHKSd_us+T$;_JAj4MkgeO2gX&Y2_+p4sh`wH%JKHSFA;BsZvV$;^T z2}5@kr=>wBuau;Q38}$H;~X3fnt88#F)LvI!PYEYpU2MxEhgGMb$k2vhn9f? zd(&&KM_hv?{1jJl2E71N6mAMC#-gFl!a8bO1ph?lL*rjEve2h6vrxdZH5}KswNhN{ zvHneQqQNRuw_v4Rj%0X5Vv$nI6HO5^H;4Nc2pdpwmWjS8wQ%sRCU+@*YCens0*1zU z5LYeO%Ljv3ZL=hS_h6l@qsGs@yCgxE%tb!xD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&Hx)Lw^GvST zUqy=bO&cqeYQ<$8UrsOqnZJn%+~J!w;o`7EUr5C+zr${&(W)PhY(R6W`meHK1}Nz( zU&r^pB8gEQ^zG&b39k@2V zu*FdnX~vd#SbybbZ81ChhXjxkFSUrmnBsmquk_u3(Z2F_%ZFJGXaOc7{K_BtYNfHE za5qtjfkV;TZSjG5c5e4l9!dYzO(eA+hdWHs`)v^!6%M2KQ7}& zUjHP^doe$w)>XiU)X|Y2x#itL+7stZcXG;*^}1t&UYE)RVQ=la#w^D1>;;G>*RSk6 wu(XUGBmD}YP8i~HVa(?~u{V%Y`w%jK(D<2yv+Sb9?;o3R9YgIBO+?uL0N(G@sQ>@~ literal 0 HcmV?d00001 diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/vendor/mail/html/button.blade.php new file mode 100644 index 000000000..e74fe55a7 --- /dev/null +++ b/resources/views/vendor/mail/html/button.blade.php @@ -0,0 +1,19 @@ + + + + + diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/vendor/mail/html/footer.blade.php new file mode 100644 index 000000000..3ff41f89c --- /dev/null +++ b/resources/views/vendor/mail/html/footer.blade.php @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php new file mode 100644 index 000000000..fa1875caa --- /dev/null +++ b/resources/views/vendor/mail/html/header.blade.php @@ -0,0 +1,11 @@ + + + +@if (trim($slot) === 'Laravel') + +@else +{{ $slot }} +@endif + + + diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/vendor/mail/html/layout.blade.php new file mode 100644 index 000000000..21d349b39 --- /dev/null +++ b/resources/views/vendor/mail/html/layout.blade.php @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.php new file mode 100644 index 000000000..b5adaa77e --- /dev/null +++ b/resources/views/vendor/mail/html/message.blade.php @@ -0,0 +1,27 @@ +@component('mail::layout') + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot + + {{-- Body --}} + {{ $slot }} + + {{-- Subcopy --}} + @isset($subcopy) + @slot('subcopy') + @component('mail::subcopy') + {{ $subcopy }} + @endcomponent + @endslot + @endisset + + {{-- Footer --}} + @slot('footer') + @component('mail::footer') + © {{ date('Y') }} {{ config('app.name') }} +@endcomponent +@endslot +@endcomponent diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/vendor/mail/html/panel.blade.php new file mode 100644 index 000000000..2975a60a0 --- /dev/null +++ b/resources/views/vendor/mail/html/panel.blade.php @@ -0,0 +1,14 @@ + + + + + + diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/vendor/mail/html/subcopy.blade.php new file mode 100644 index 000000000..790ce6c24 --- /dev/null +++ b/resources/views/vendor/mail/html/subcopy.blade.php @@ -0,0 +1,7 @@ + + + + + diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/vendor/mail/html/table.blade.php new file mode 100644 index 000000000..a5f3348b2 --- /dev/null +++ b/resources/views/vendor/mail/html/table.blade.php @@ -0,0 +1,3 @@ +
+{{ Illuminate\Mail\Markdown::parse($slot) }} +
diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css new file mode 100644 index 000000000..95c3cd1e2 --- /dev/null +++ b/resources/views/vendor/mail/html/themes/default.css @@ -0,0 +1,296 @@ +/* Base */ + +body, +body *:not(html):not(style):not(br):not(tr):not(code) { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; + position: relative; +} + +html{ + min-height: 100%; + height: 100%; +} + +body { + -webkit-text-size-adjust: none; + background-color: #edf2f7; + color: #718096; + min-height: 100%; + height: 100%; + line-height: 1.4; + margin: 0; + padding: 0; + width: 100% !important; +} + +p, +ul, +ol, +blockquote { + line-height: 1.4; + text-align: left; +} + +a { + color: #3869d4; +} + +a img { + border: none; +} + +/* Typography */ + +h1 { + color: #3d4852; + font-size: 18px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h2 { + font-size: 16px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +h3 { + font-size: 14px; + font-weight: bold; + margin-top: 0; + text-align: left; +} + +p { + font-size: 16px; + line-height: 1.5em; + margin-top: 0; + text-align: left; +} + +p.sub { + font-size: 12px; +} + +img { + max-width: 100%; +} + +/* Layout */ + +.wrapper { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + background-color: #edf2f7; + margin: 0; + padding: 0; + width: 100%; +} + +.content { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 0; + padding: 0; + width: 100%; +} + +/* Header */ + +.header { + padding: 25px 0; + text-align: center; +} + +.header a { + color: #3d4852; + font-size: 19px; + font-weight: bold; + text-decoration: none; +} + +/* Logo */ + +.logo { + height: 75px; + max-height: 75px; + width: 75px; +} + +/* Body */ + +.body { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + background-color: #edf2f7; + border-bottom: 1px solid #edf2f7; + border-top: 1px solid #edf2f7; + margin: 0; + padding: 0; + width: 100%; +} + +.inner-body { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; + background-color: #ffffff; + border-color: #e8e5ef; + border-radius: 2px; + border-width: 1px; + box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); + margin: 0 auto; + padding: 0; + width: 570px; +} + +/* Subcopy */ + +.subcopy { + border-top: 1px solid #e8e5ef; + margin-top: 25px; + padding-top: 25px; +} + +.subcopy p { + font-size: 14px; +} + +/* Footer */ + +.footer { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 570px; + margin: 0 auto; + padding: 0; + text-align: center; + width: 570px; +} + +.footer p { + color: #b0adc5; + font-size: 12px; + text-align: center; +} + +.footer a { + color: #b0adc5; + text-decoration: underline; +} + +/* Tables */ + +.table table { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 30px auto; + width: 100%; +} + +.table th { + border-bottom: 1px solid #edeff2; + margin: 0; + padding-bottom: 8px; +} + +.table td { + color: #74787e; + font-size: 15px; + line-height: 18px; + margin: 0; + padding: 10px 0; +} + +.content-cell { + max-width: 100vw; + padding: 32px; +} + +/* Buttons */ + +.action { + -premailer-cellpadding: 0; + -premailer-cellspacing: 0; + -premailer-width: 100%; + margin: 30px auto; + padding: 0; + text-align: center; + width: 100%; +} + +.button { + -webkit-text-size-adjust: none; + border-radius: 4px; + color: #fff; + display: inline-block; + overflow: hidden; + text-decoration: none; +} + +.button-blue, +.button-primary { + background-color: #2d3748; + border-bottom: 8px solid #2d3748; + border-left: 18px solid #2d3748; + border-right: 18px solid #2d3748; + border-top: 8px solid #2d3748; +} + +.button-green, +.button-success { + background-color: #48bb78; + border-bottom: 8px solid #48bb78; + border-left: 18px solid #48bb78; + border-right: 18px solid #48bb78; + border-top: 8px solid #48bb78; +} + +.button-red, +.button-error { + background-color: #e53e3e; + border-bottom: 8px solid #e53e3e; + border-left: 18px solid #e53e3e; + border-right: 18px solid #e53e3e; + border-top: 8px solid #e53e3e; +} + +/* Panels */ + +.panel { + border-left: #2d3748 solid 4px; + margin: 21px 0; +} + +.panel-content { + background-color: #edf2f7; + color: #718096; + padding: 16px; +} + +.panel-content p { + color: #718096; +} + +.panel-item { + padding: 0; +} + +.panel-item p:last-of-type { + margin-bottom: 0; + padding-bottom: 0; +} + +/* Utilities */ + +.break-all { + word-break: break-all; +} diff --git a/resources/views/vendor/mail/text/button.blade.php b/resources/views/vendor/mail/text/button.blade.php new file mode 100644 index 000000000..97444ebdc --- /dev/null +++ b/resources/views/vendor/mail/text/button.blade.php @@ -0,0 +1 @@ +{{ $slot }}: {{ $url }} diff --git a/resources/views/vendor/mail/text/footer.blade.php b/resources/views/vendor/mail/text/footer.blade.php new file mode 100644 index 000000000..3338f620e --- /dev/null +++ b/resources/views/vendor/mail/text/footer.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/text/header.blade.php b/resources/views/vendor/mail/text/header.blade.php new file mode 100644 index 000000000..aaa3e5754 --- /dev/null +++ b/resources/views/vendor/mail/text/header.blade.php @@ -0,0 +1 @@ +[{{ $slot }}]({{ $url }}) diff --git a/resources/views/vendor/mail/text/layout.blade.php b/resources/views/vendor/mail/text/layout.blade.php new file mode 100644 index 000000000..9378baa07 --- /dev/null +++ b/resources/views/vendor/mail/text/layout.blade.php @@ -0,0 +1,9 @@ +{!! strip_tags($header) !!} + +{!! strip_tags($slot) !!} +@isset($subcopy) + +{!! strip_tags($subcopy) !!} +@endisset + +{!! strip_tags($footer) !!} diff --git a/resources/views/vendor/mail/text/message.blade.php b/resources/views/vendor/mail/text/message.blade.php new file mode 100644 index 000000000..ec50544ad --- /dev/null +++ b/resources/views/vendor/mail/text/message.blade.php @@ -0,0 +1,27 @@ +@component('mail::layout') + {{-- Header --}} + @slot('header') + @component('mail::header', ['url' => config('app.url')]) + {{ config('app.name') }} + @endcomponent + @endslot + + {{-- Body --}} + {{ $slot }} + + {{-- Subcopy --}} + @isset($subcopy) + @slot('subcopy') + @component('mail::subcopy') + {{ $subcopy }} + @endcomponent + @endslot + @endisset + + {{-- Footer --}} + @slot('footer') + @component('mail::footer') + © {{ date('Y') }} {{ config('app.name') }}. + @endcomponent + @endslot +@endcomponent diff --git a/resources/views/vendor/mail/text/panel.blade.php b/resources/views/vendor/mail/text/panel.blade.php new file mode 100644 index 000000000..3338f620e --- /dev/null +++ b/resources/views/vendor/mail/text/panel.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/text/subcopy.blade.php b/resources/views/vendor/mail/text/subcopy.blade.php new file mode 100644 index 000000000..3338f620e --- /dev/null +++ b/resources/views/vendor/mail/text/subcopy.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/mail/text/table.blade.php b/resources/views/vendor/mail/text/table.blade.php new file mode 100644 index 000000000..3338f620e --- /dev/null +++ b/resources/views/vendor/mail/text/table.blade.php @@ -0,0 +1 @@ +{{ $slot }} diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.php new file mode 100644 index 000000000..2a8ebddc8 --- /dev/null +++ b/resources/views/vendor/notifications/email.blade.php @@ -0,0 +1,66 @@ +@component('mail::message') +{{-- Greeting --}} +@if (! empty($greeting)) +# {{ $greeting }} +@else +@if ($level === 'error') +# @lang('Whoops!') +@else +# @lang('Hello!') +@endif +@endif + +@slot('header') + +@endslot + +{{-- Intro Lines --}} +@foreach ($introLines as $line) +{{ $line }} + +@endforeach + +{{-- Action Button --}} +@isset($actionText) + +@component('mail::button', ['url' => $actionUrl, 'color' => $color]) +{{ $actionText }} +@endcomponent +@endisset + +{{-- Outro Lines --}} +@foreach ($outroLines as $line) +{{ $line }} + +@endforeach + +{{-- Salutation --}} +@if (! empty($salutation)) +{{ $salutation }} +@else +@lang('Regards'),
+{{ config('app.name') }} +@endif + +{{-- Subcopy --}} +@isset($actionText) +@slot('subcopy') +@lang( + "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\n". + 'into your web browser:', + [ + 'actionText' => $actionText, + ] +) [{{ $displayableActionUrl }}]({{ $actionUrl }}) +@endslot +@endisset +@endcomponent -- 2.39.5