邮件编辑器中添加三方物流查询链接

效果展示,这里以 17track 为例

邮件内容

点击跳转展示

操作流程

添加一个富文本组件

将富文本组件挪到想放置的位置

在富文本配置处添加一个「运单号」的动态源

开启代码模式,并替换代码

说明:

  1. 如需改动文案,需调整代码中第 30 行
  2. 当前编辑器内置 helper,可查看 https://github.com/helpers/handlebars-helpers
  3. 富文本控件的内容可通过 {{ section.settings.content }} 进行获取
  4. 以下为截取出来的运单号原文 {{sanitize (replace section.settings.content "Tracking Number: " “”)}}
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="pg-rich-text-{{section.id}}-outlook" role="presentation" style="width:{{theme.settings.page_margins}};" width="NaN" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div class="pg-rich-text-{{section.id}}" style="margin:0px auto;max-width:{{theme.settings.page_margins}};">
  <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
    <tbody>
      <tr>
        <td style="direction:{{#if rtlConf.isRtl}}rtl{{else}}ltr{{/if}};font-size:0px;padding:{{section.settings.margin.pc.top}}px {{section.settings.margin.pc.right}}px {{section.settings.margin.pc.bottom}}px {{section.settings.margin.pc.left}}px;text-align:center;">
          <!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><![endif]-->
          <style>
            .mjml-root .pg-rich-text-{{section.id}} * {
            font-family: {{#if (eq section.settings.content_font_family.font-family 'inherit')}} inherit {{else}} {{section.settings.content_font_family.font-family}} !important{{/if}};
            }
            {{#if section.settings.content_font_family.font-url}}
            @font-face {
            font-family: {{section.settings.content_font_family.font-family}};
            		src: url({{section.settings.content_font_family.font-url}});
            	}
            {{/if}}
          </style>
          <!--[if mso | IE]><td class="" style="vertical-align:top;width:NaNpx;" ><![endif]-->
          <div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:{{#if rtlConf.isRtl}}rtl{{else}}ltr{{/if}};display:inline-block;vertical-align:top;width:100%;">
            <table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
              <tbody>
                <tr>
                  <td style="background-color:{{section.settings.background_color}};vertical-align:top;padding:{{section.settings.padding.pc.top}}px {{section.settings.padding.pc.right}}px {{section.settings.padding.pc.bottom}}px {{section.settings.padding.pc.left}}px;">
                    <table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
                      <tbody>
                        <tr>
                          <td align="{{#if rtlConf.isRtl}}right{{else}}left{{/if}}" style="font-size:0px;padding:0;word-break:break-word;">
                            <div style="font-family:{{#if (eq section.settings.content_font_family.font-family 'inherit')}} inherit {{else}} {{section.settings.content_font_family.font-family}} !important{{/if}};font-size:14px;line-height:normal;text-align:{{#if rtlConf.isRtl}}right{{else}}left{{/if}};color:#474F5E;">
                              Tracking Number : <a href="https://t.17track.net/zh-cn#nums={{sanitize (replace section.settings.content "Tracking Number: " "")}}" target="_blank">{{sanitize (replace section.settings.content "Tracking Number: " "")}}</a>
                            </div>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <!--[if mso | IE]></td></tr></table><![endif]-->
        </td>
      </tr>
    </tbody>
  </table>
</div>
<!--[if mso | IE]></td></tr></table><![endif]-->