php 添加跟踪信息到电子邮件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 添加跟踪信息到电子邮件相关的知识,希望对你有一定的参考价值。

<!-- SET UP FOR ACF:

Delivery Service - select - field choices of Not Shipped, UPS, FedEx, USPS 
  UPS - text - conditional logic on: delivery service value is equal to UPS
  Fedex - text - conditional logic on: delivery service value is equal to Fedex
  USPS - text - conditional logic on: delivery service value is equal to USPS


Post Type = Order

-->




<!-- AROUND LINE 30 -->

<!-- Only display text if no numbers have been entered -->
<?php if( get_field('delivery_service', $curauth) == "Not Shipped" ): ?>
<p>Your order has shipped.</p>
<?php endif; ?>

<!-- Display number if UPS is selected as delivery service -->
<?php if( get_field('delivery_service', $curauth) == "UPS" ): ?>
	 <?php if( get_field('ups_tracking') ): ?>
	 <p>Your order has shipped. Track your package below.</p>
        <button><a class="link" style="margin: 0px auto;" href="https://www.ups.com/track?loc=en_US&tracknum=<?php the_field('ups_tracking'); ?>&requester=WT/trackdetails">TRACK PACKAGE</a></button>
     <?php endif; ?>

<!-- Display number if USPS is selected as delivery service -->     
<?php elseif( get_field('delivery_service', $curauth) == "USPS" ): ?>
     <?php if( get_field('usps_tracking') ): ?>
     <p>Your order has shipped. Track your package below.</p>
        <button><a class="link" style="margin: 0px auto;" href="https://tools.usps.com/go/TrackConfirmAction?tLabels=<?php the_field('usps_tracking'); ?>">TRACK PACKAGE</a></button>
    <?php endif; ?>

	
<!-- Display number if FEDEX is selected as delivery service -->
<?php elseif( get_field('delivery_service', $curauth) == "FedEx" ): ?>
    <?php if( get_field('fedex_tracking') ): ?>
    <p>Your order has shipped. Track your package below.</p>
        <button><a class="link" style="margin: 0px auto;" href="https://www.fedex.com/apps/fedextrack/?action=track&action=track&tracknumbers=<?php the_field('fedex_tracking');?>&requester=WT/trackdetails">TRACK PACKAGE</a></button>
    <?php endif; ?>

<?php endif; ?>

以上是关于php 添加跟踪信息到电子邮件的主要内容,如果未能解决你的问题,请参考以下文章

php 在我的帐户中添加跟踪信息(Orders.php和View-Order.php)

使用 PHP 和图像跟踪电子邮件

text 将电子商务跟踪代码添加到感谢页面

php 将跟踪代码添加到wp谢谢页面

我如何跟踪退回的电子邮件?

php 将Google Analytics跟踪代码添加到WordPress的简单插件