[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 email_welcome.php

Zen Cart 源代码 email_welcome.php




下载文件

文件名: email_welcome.php
文件类型: PHP文件
文件大小: 8.66 KiB
MD5: 3ea43a8ebdddf66ba4fd6507261c16f4

email_welcome.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2007 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: email_welcome.php 5805 2007-02-18 04:27:17Z ajeh $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12.   require(DIR_WS_CLASSES . 'currencies.php');
  13.   $currencies = new currencies();
  14.  
  15.   if (file_exists(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . (($template_dir=='') ? '' : '/'.$template_dir) .'/' . 'create_account.php')) {
  16.     require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . (($template_dir=='') ? '' : '/'.$template_dir) . '/' . 'create_account.php');
  17.   } else {
  18.     require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . 'create_account.php');
  19.   }
  20.  
  21. // build the message content
  22.       $name = 'Fred Smith';
  23.       $firstname = 'Fred';
  24.       $lastname = 'Smith';
  25.       $gender='m';
  26.       $email_address='fredsmith@somewhere.com';
  27.  
  28. // build the message content
  29.  
  30.       if (ACCOUNT_GENDER == 'true') {
  31.          if ($gender == 'm') {
  32.            $email_text = sprintf(EMAIL_GREET_MR, $lastname);
  33.          } else {
  34.            $email_text = sprintf(EMAIL_GREET_MS, $lastname);
  35.          }
  36.       } else {
  37.         $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  38.       }
  39.       $html_msg['EMAIL_GREETING'] = str_replace('\n','',$email_text);
  40.       $html_msg['EMAIL_FIRST_NAME'] = $firstname;
  41.       $html_msg['EMAIL_LAST_NAME']  = $lastname;
  42.  
  43.       // initial welcome
  44.       $email_text .=  EMAIL_WELCOME;
  45.       $html_msg['EMAIL_WELCOME'] = str_replace('\n','',EMAIL_WELCOME);
  46.  
  47.       if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
  48.         $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
  49.         $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
  50.         $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
  51. //        $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");
  52.  
  53.       // if on, add in Discount Coupon explanation
  54.         $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
  55.                        (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') .
  56.                        strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR ;
  57.  
  58.       $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
  59.       $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
  60.       $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
  61.       $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'];
  62.       }
  63.  
  64.       if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
  65.         $coupon_code = 'ABCDEF';
  66. //        $insert_query = $db->Execute("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
  67. //        $insert_id = $db->Insert_ID();
  68. //        $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");
  69.  
  70.       // if on, add in GV explanation
  71.         $email_text .= "\n\n" . sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) .
  72.                        sprintf(EMAIL_GV_REDEEM, $coupon_code) .
  73.                        EMAIL_GV_LINK . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . "\n\n" .
  74.                        EMAIL_GV_LINK_OTHER . EMAIL_SEPARATOR;
  75.         $html_msg['GV_WORTH'] = str_replace('\n','',sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) );
  76.         $html_msg['GV_REDEEM'] = str_replace('\n','',str_replace('\n\n','<br />',sprintf(EMAIL_GV_REDEEM, '<strong>' . $coupon_code . '</strong>')));
  77.         $html_msg['GV_CODE_NUM'] = $coupon_code;
  78.         $html_msg['GV_CODE_URL'] = str_replace('\n','',EMAIL_GV_LINK . '<a href="' . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . '">' . TEXT_GV_NAME . ': ' . $coupon_code . '</a>');
  79.         $html_msg['GV_LINK_OTHER'] = EMAIL_GV_LINK_OTHER;
  80.       }
  81.  
  82.       // add in regular email welcome text
  83.       $email_text .= "\n\n" . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_GV_CLOSURE;
  84.  
  85.       $html_msg['EMAIL_MESSAGE_HTML']  = str_replace('\n','',EMAIL_TEXT);
  86.       $html_msg['EMAIL_CONTACT_OWNER'] = str_replace('\n','',EMAIL_CONTACT);
  87.       $html_msg['EMAIL_CLOSURE']       = nl2br(EMAIL_GV_CLOSURE);
  88.  
  89. // include create-account-specific disclaimer
  90.       $email_text .= "\n\n" . sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, STORE_OWNER_EMAIL_ADDRESS). "\n\n";
  91.       $html_msg['EMAIL_DISCLAIMER'] = sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, '<a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">'. STORE_OWNER_EMAIL_ADDRESS .' </a>');
  92.  
  93.       $html_msg['EMAIL_TO_NAME'] = $name;
  94.       $html_msg['EMAIL_TO_ADDRESS'] = $email_address;
  95.       $html_msg['EMAIL_SUBJECT'] = $EMAIL_SUBJECT;
  96.       $html_msg['EMAIL_FROM_NAME'] = $STORE_NAME;
  97.       $html_msg['EMAIL_FROM_ADDRESS'] = $EMAIL_FROM;
  98.       $extra_info=email_collect_extra_info(STORE_NAME, EMAIL_FROM, $name, $email_address );
  99.       $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
  100.       $email_html = zen_build_html_email_from_template('welcome_extra', $html_msg);
  101. //   zen_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg, 'welcome');
  102.  
  103.  
  104.  
  105. ?>
  106. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  107. <html <?php echo HTML_PARAMS; ?>>
  108. <head>
  109. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  110. <title><?php echo TITLE; ?></title>
  111. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  112. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  113. <script language="javascript" src="includes/menu.js"></script>
  114. <script language="javascript" src="includes/general.js"></script>
  115. <script type="text/javascript">
  116.   <!--
  117.   function init()
  118.   {
  119.     cssjsmenu('navbar');
  120.     if (document.getElementById)
  121.     {
  122.       var kill = document.getElementById('hoverJS');
  123.       kill.disabled = true;
  124.     }
  125.   }
  126.   // -->
  127. </script>
  128. </head>
  129. <body onload="init()">
  130. <!-- header //-->
  131. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  132. <!-- header_eof //-->
  133.  
  134. <!-- body_text //-->
  135. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  136.   <tr>
  137.     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  138.       <tr>
  139.         <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  140.         <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  141.       </tr>
  142.       <tr>
  143.         <td class="errorText" colspan="2"><?php echo HEADING_SUBTITLE; ?></td>
  144.       </tr>
  145.     </table></td>
  146.   </tr>
  147.   <tr>
  148.     <td><table border="2" width="625" cellspacing="0" cellpadding="20" align="center">
  149. <?php if (EMAIL_USE_HTML=='true') { ?>
  150.       <tr><td width="100%"><table border="0" cellpadding="0" width="100%">
  151.         <tr>
  152.           <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  153.         </tr>
  154.  
  155.         <tr>
  156.           <td class="main"><?php echo TEXT_SUBJECT . ' ' . EMAIL_SUBJECT; ?></td>
  157.         </tr>
  158.  
  159.         <tr>
  160.           <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
  161.         </tr>
  162.  
  163.         <tr>
  164.           <td class="main"><?php echo $email_html; ?></td>
  165.         </tr>
  166.  
  167.       </table></td></tr>
  168. <?php } ?>
  169.  
  170.       <tr><td width="100%"><table border="0" cellpadding="0" width="100%">
  171.         <tr>
  172.           <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  173.         </tr>
  174.  
  175.         <tr>
  176.           <td class="main"><?php echo TEXT_SUBJECT . ' ' . EMAIL_SUBJECT; ?></td>
  177.         </tr>
  178.  
  179.         <tr>
  180.           <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
  181.         </tr>
  182.  
  183.         <tr>
  184.           <td class="main"><?php echo nl2br(strip_tags($email_text)); ?></td>
  185.         </tr>
  186.  
  187.       </table></td></tr>
  188.     </table></td>
  189.   </tr>
  190. </table>
  191. <!-- body_text_eof //-->
  192. <br>
  193. </body>
  194. </html>
  195. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


cron