本文整理汇总了PHP中Shopp::email_to方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::email_to方法的具体用法?PHP Shopp::email_to怎么用?PHP Shopp::email_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopp
的用法示例。
在下文中一共展示了Shopp::email_to方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email
public function email($addressee, $address, $subject, array $templates = array())
{
global $is_IIS;
shopp_debug("ShoppPurchase::email(): {$addressee},{$address},{$subject}," . _object_r($templates));
// Build the e-mail message data
$email['from'] = Shopp::email_from(shopp_setting('merchant_email'), shopp_setting('business_name'));
if ($is_IIS) {
$email['to'] = Shopp::email_to($address);
} else {
$email['to'] = Shopp::email_to($address, $addressee);
}
$email['subject'] = $subject;
$email['receipt'] = $this->receipt();
$email['url'] = get_bloginfo('url');
$email['sitename'] = get_bloginfo('name');
$email['orderid'] = $this->id;
$email = apply_filters('shopp_email_receipt_data', $email);
$email = apply_filters('shopp_purchase_email_message', $email);
$this->message = array_merge($this->message, $email);
// Load and process the template file
$defaults = array('email.php', 'order.php', 'order.html');
$emails = array_merge((array) $templates, $defaults);
$template = Shopp::locate_template($emails);
if (!file_exists($template)) {
shopp_add_error(Shopp::__('A purchase notification could not be sent because the template for it does not exist.'), SHOPP_ADMIN_ERR);
return false;
}
// Send the email
if (Shopp::email($template, $this->message)) {
shopp_debug('A purchase notification was sent to: ' . $this->message['to']);
return true;
}
shopp_debug('A purchase notification FAILED to be sent to: ' . $this->message['to']);
return false;
}
示例2: notification
/**
* Send new customer notification emails
*
* @author Jonathan Davis
* @since 1.2
*
* @return void
**/
public function notification()
{
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$business = shopp_setting('business_name');
$merchant = shopp_setting('merchant_email');
$_ = array();
$_[] = 'From: ' . Shopp::email_from($merchant, $business);
$_[] = 'To: ' . Shopp::email_to($merchant);
$_[] = 'Subject: ' . Shopp::__('[%s] New Customer Registration', $blogname);
$_[] = '';
$_[] = Shopp::__('New customer registration on your "%s" store:', $blogname);
$_[] = Shopp::__('E-mail: %s', stripslashes($this->email));
$_ = apply_filters('shopp_merchant_new_customer_notification', $_);
if (!Shopp::email(join("\n", $_))) {
shopp_add_error('The new account notification e-mail could not be sent.', SHOPP_ADMIN_ERR);
} else {
shopp_debug('A new account notification e-mail was sent to the merchant.');
}
if (empty($this->password)) {
return;
}
$_ = array();
$_[] = 'From: ' . Shopp::email_from($merchant, $business);
$_[] = 'To: ' . $this->email;
$_[] = 'Subject: ' . Shopp::__('[%s] New Customer Registration', $blogname);
$_[] = '';
$_[] = Shopp::__('New customer registration on your "%s" store:', $blogname);
$_[] = Shopp::__('E-mail: %s', stripslashes($this->email));
$_[] = Shopp::__('Password: %s', $this->password);
$_[] = '';
$_[] = Shopp::url(false, 'account', ShoppOrder()->security());
$_ = apply_filters('shopp_new_customer_notification', $_);
if (!Shopp::email(join("\n", $_))) {
shopp_add_error('The customer's account notification e-mail could not be sent.', SHOPP_ADMIN_ERR);
} else {
shopp_debug('A new account notification e-mail was sent to the customer.');
}
}