微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Sendgrid 不呈现 AMP 电子邮件

如何解决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 举报,一经查实,本站将立刻删除。