如何在不使用 markdown 的情况下将纯文本版本添加到 Laravel 电子邮件
How to add plaintext version to Laravel email without using markdown
我有一些 html 电子邮件对于降价可能有点过于自定义,但我想向它们添加纯文本版本。我知道 markdown 电子邮件两者都可以,但我可以手动将纯文本版本添加到可邮寄邮件中吗?
If you would like to define a plain-text version of your email, you
may use the text
method. Like the view
method, the text
method accepts
a template name which will be used to render the contents of the
email. You are free to define both a HTML and plain-text version of
your message:
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.orders.shipped')
->text('emails.orders.shipped_plain');
}
我有一些 html 电子邮件对于降价可能有点过于自定义,但我想向它们添加纯文本版本。我知道 markdown 电子邮件两者都可以,但我可以手动将纯文本版本添加到可邮寄邮件中吗?
If you would like to define a plain-text version of your email, you may use the
text
method. Like theview
method, thetext
method accepts a template name which will be used to render the contents of the email. You are free to define both a HTML and plain-text version of your message:
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->view('emails.orders.shipped')
->text('emails.orders.shipped_plain');
}