Sendgrid 不呈现 AMP 电子邮件

问题描述

我在 Laravel 中设置了一个 AMP 电子邮件并使用 Sendgrid 作为邮件驱动程序。

以下可邮寄:

public function build()
    {

        $amp = View::make('emails.amp.test');

        $this->view('emails.amp.test')
            ->subject('Amp test')
            ->from("notifications@myapp1234.com",'MyApp');

        return $this->withSwiftMessage(function (\Swift_Message $message) use ($amp) {
            $message->addPart($amp->render(),'text/x-amp-html','utf-8');
        });

    }

以下是视图 (emails.amp.test):

 <!doctype html>
    <html ⚡4email>
    <head>
        <Meta charset="utf-8">
        <script async src="https://cdn.ampproject.org/v0.js"></script>
    
        <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
        <script async custom-element="amp-selector" src="https://cdn.ampproject.org/v0/amp-selector-0.1.js"></script>
        <script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
    
        <style amp4email-boilerplate>
        body {
                visibility: hidden;
            }
        </style>
        <style amp-custom>
table {
            background: rgb(241,244,247) none repeat;
            width: 100%;
            padding: 30px 100px;
            margin-left: auto;
            margin-right: auto;
            color: rgb(10,8,58);
            max-width: 800px;
        }
</style>
    </head>
    <body>
    <table role="presentation" cellspacing="0" cellpadding="0" border="0">
            <tbody>
                
                <tr>
                    <td><amp-img
                      alt="A view of the sea"
                      src="https://cdn.pixabay.com/photo/2014/02/27/16/10/tree-276014__340.jpg"
                      width="900"
                      height="675"
                      layout="responsive"
                    >
                    </amp-img></td>
                </tr>
            </tbody>
        </table>
    </body>
    </html>

我还在 Gmail 设置中启用了动态电子邮件以及白名单发件人地址。在 Sendgrid 中验证域。发件人地址 SPF 和 DKIM 已通过。

但是当我发送电子邮件时,它在 Gmail 中显示为这样。

Image

我什至无法调试它。

提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)