电子邮件模板问题-WP发票-Wordpress

时间:2019-02-07 20:31:45

标签: php wordpress

我为WP发票设计了一个电子邮件模板。

我已经这样设计了模板:

<div style="width:100%; background-color:#efefef;">
    <div style="width:80%; margin-left:10%; background-color:white; padding:25px;">   
        <p>Dear %recipient%,<p> 
        <div style="width:80%; margin-left:10%; background-color:#eaeaea; text-align:center; padding:50px 0">
            <p>%business_name% has sent you the %type% for:</p> 
            <p style="font-weight:bolder; font-size:20px;">%amount%</p> 
            <p style="padding-bottom:15px">You may pay, view and print the invoice PDF online by visiting the following link:<p>
            <div style="width:30%; padding:0 35%">
                <button style="background:#018fcf; border:0; border-radius:35px; padding:15px 70px; margin:auto;"><a style="color:white; font-size:20px; href="%link%">View invoice</a></button>
            </div>
        </div>
        <div style="margin-top:25px; margin-bottom:25px;">          
            <p>%description%</p> 
        </div>
        <div style="margin-top:25px; margin-bottom:25px;">
            <p>For questions about this invoice, please contact</p>
                  <a href="mailto:accounts@email.co.uk">mailto:accounts@email.co.uk</a>
        <div>
            <p>Best regards,</p>
            <p>%business_name%</p> 
            <p>%business_email%</p>
        </div>
    </div>
</div>

问题是,我需要在发送之前编辑电子邮件。

样式被否定,因为插件似乎在开始和结束处插入了'\':

<div style="\....\">....</div>

<div style=\"width:80%; margin-left:10%; background-color:white; padding:25px;\">....</div>

有人知道如何防止插件或Wordpress添加斜线吗?

1 个答案:

答案 0 :(得分:1)

我不能保证这会起作用。我看了看插件的代码,它看起来像是在-行196 class.ajax.php

中发送了电子邮件

尝试将以下内容添加到主题的functions.php

static function send_notification

请注意,如果可以,它将从邮件正文中删除所有反斜杠

相关问题