email

WordPress 邮件回复提醒的内容模板

本文分享自用的 WordPress 邮件回复提醒的正文内容模板,和前面文章一样,这不是教程只是个人的备忘录,以免哪天自己想用的时候(比如更换主题)忘了不是~


WordPress邮件回复提醒的内容模板
<div style="background: #f8f8f8; color: #666; font-size: 12px">
  <div style="width: 570px;margin: 0 auto;background: #fff;padding: 25px 70px;border-top: 5px solid #666;">
    <div style="text-align: center; margin-bottom: 40px; line-height: 1.8em">
      <h1 style="color:#333;font: 35px/0.5 &quot;ff-tisa-web-pro&quot;,&quot;Times New Roman&quot; !important;font-style:italic !important;">THE LONELY SHEPHERD</h1>
      <p style="text-indent: 1.3em">世事洞明皆学问,人情练达即文章</p>
    </div>
    <p style="font-size:18px;color: #333;">你好 ' . trim(get_comment($parent_id)->comment_author) . '</p>
    <p>您曾在 [牧羊人博客] 的文章 《' . get_the_title($comment->comment_post_ID) . '》 上发表评论:
        <p style="border: 1px solid #eee;padding: 20px;margin: 15px 0;">' . nl2br(get_comment($parent_id)->comment_content) . '</p>
        <p>' . trim($comment->comment_author) . ' 给您的回复如下:
                <p style="border: 1px solid #eee;padding: 20px;margin: 15px 0;">' . nl2br($comment->comment_content) . '</p>
                <p class="footer" style="border-top: 1px solid #DDDDDD; padding-top:6px; margin-top:15px; color:#838383;text-align:center;">您可以 <a style="text-decoration:none; color:#c33" href="' . htmlspecialchars(get_comment_link($parent_id)) . '">按此查看完整内容</a> | 欢迎再次来访 <a style="text-decoration:none; color:#c33" href="https://www.shephe.com/">牧羊人博客</a>.</p>
        </div>
</div>

以下这段样式来自@飞牛式,跟上面一段其实差不多,只不过加了内容背景。其实不懂 HTML 代码的你我还有个办法来美化邮件内容,可以用诸如 Email Templates Customizer and Designer for WordPress and WooCommerce 的插件来图形化自定义。

<div style="background-color:#fff;text-align:center;padding:10px;">
    <div class="mmsgLetter" style="width:580px;margin:50px auto;padding:10px;color:#333;background-color:#fff;border:0px solid #aaa;border-radius:5px;-webkit-box-shadow:3px 3px 10px #999;-moz-box-shadow:3px 3px 10px #999;box-shadow:3px 3px 10px #999;font-family:Verdana, sans-serif;">
        <div class="mmsgLetterHeader" style="height:23px;background:url(https://www.shephe.com/wp-content/feature/mmsgletter_bg_topline.webp) repeat-x 0 0;">
        </div>
        <div class="mmsgLetterContent" style="text-align:left;padding:30px;font-size:16px;line-height:1.5;background:url(https://www.shephe.com/wp-content/feature/mmsgletter_bg_totem.webp) no-repeat top right;">
            <div>
                <p class="salutation" style="font-weight:bold;">Hi,<span id="mailUserName"><?php echo $parent->comment_author; ?> </span>:</p>
                <p>您在 《<a style="text-decoration:none; color:#407700" href="<?php echo get_permalink($parent->comment_post_ID) ?>"><?php echo get_the_title($parent->comment_post_ID) ?></a> 》上发表的评论:</p>
                <p style="background-color: #f5f5f5;border: 0px solid #DDD;padding: 10px 15px;margin:18px 0"><?php echo esc_html($parent->comment_content); ?></p>
                <p><?php echo $comment->comment_author; ?>  给您的回复如下:</p>
                <p style="background-color: #f5f5f5;border: 0px solid #DDD;padding: 10px 15px;margin:18px 0"><?php echo esc_html($comment->comment_content); ?></p>
                <p>您可以点击 <a style="text-decoration:none; color:#407700" href="<?php echo get_comment_link($parent->comment_ID) ?>">点击这里回复 </a>,欢迎关注 <a style="text-decoration:none; color:#407700" href="https://www.feinews.com">Feinews.com </a>。</p>
                                 <p></p>
                <p>(邮件为系统自动发出,请勿直接回复!)</p>
            </div>

            <div class="mmsgLetterInscribe" style="padding:40px 0 0;">
                <img class="mmsgAvatar" src="https://www.shephe.com/wp-content/feature/favicon.ico" style="float:left; width: 50px; height: 50px; border-radius: 4px;" />
                <div class="mmsgSender" style="margin:0 0 0 54px;">
                    <p class="mmsgName" style="margin:0 10px 10px;" >牧羊人 - xx</p>
                    <p class="mmsgInfo" style="font-size:12px;margin:0 10px 10px;line-height:1.2;"> 世事洞明皆学问 人情练达即文章 </p>
                </div>
            </div>
        </div>
    </div>
</div>

#本文实发日期 2024.03.24

4329 3465 Kevin's

发表评论

请输入关键词…