【发布时间】:2018-12-15 15:42:25
【问题描述】:
我正在使用 laravel 通知发送电子邮件,但我想知道如何在文本行之间的电子邮件视图中显示表格。
我正在使用 laravel 的默认视图,但我不知道如何传递表格'
这是我的 toMail 方法:
public function toMail($notifiable)
{
$message = new MailMessage();
$message->subject('Command confirmation n°'.$this->order->id)
->replyTo('noreply@example.com')
->line('Thanks to choose us!')
->line('Here the details of your order n°'.$this->order->id);
foreach($this->order->cart as $item){
// here the table
}
$message->line('To see your order click here');
$message->action('My orders', url('http://www.example.com/espace-perso/mes-commandes'))
return $message;
}
在 email.blade.php 视图(默认 laravel 视图)我有:
{{-- Action Button --}}
@isset($actionText)
<?php
switch ($level) {
case 'success':
$color = 'green';
break;
case 'error':
$color = 'red';
break;
default:
$color = 'blue';
}
?>
@component('mail::button', ['url' => $actionUrl, 'color' => $color])
{{ $actionText }}
@endcomponent
@endisset
{{-- Outro Lines --}}
@foreach ($outroLines as $line)
{{ $line }}
@endforeach
markdown 表如何放置,以及如何在行间放置,比如操作按钮?
【问题讨论】: