本文整理汇总了PHP中Subscriber::replaceCustomFieldValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::replaceCustomFieldValues方法的具体用法?PHP Subscriber::replaceCustomFieldValues怎么用?PHP Subscriber::replaceCustomFieldValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber::replaceCustomFieldValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: str_replace
$confirm_body = str_replace("[!date!]", $date, $confirm_body);
$confirm_subject = str_replace("[!url!]", $url, $confirm_subject);
$confirm_body = str_replace("[!url!]", $url, $confirm_body);
$confirm_subject = str_replace("[!newslettername!]", $newslettername, $confirm_subject);
$confirm_body = str_replace("[!newslettername!]", $newslettername, $confirm_body);
$confirm_subject = str_replace("[!address!]", $address, $confirm_subject);
$confirm_body = str_replace("[!address!]", $address, $confirm_body);
$confirm_body = str_replace("[!confirm!]", $confirm, $confirm_body);
$additional_parameters = array("ipaddress" => $_SERVER['REMOTE_ADDR'], "date" => date("g:i d F Y", time()), "url" => $_SERVER['HTTP_REFERER']);
$params = array();
date_default_timezone_set($zone);
$params[0] = $confirm_subject;
$params[1] = $confirm_body;
$subscriber = new Subscriber($id);
foreach ($params as $index => $value) {
$params[$index] = Subscriber::replaceCustomFieldValues($value, $subscriber);
}
$from_email = $newsletter->fromemail;
if (!$from_email) {
$from_email = get_bloginfo("admin_email");
}
$from_name = $newsletter->fromname;
if (!$from_name) {
$from_name = get_bloginfo("name");
}
$subject = $params[0];
$body = $params[1];
$verificationEmail = array('to' => $email, 'subject' => $subject, 'textbody' => $body, 'fromname' => $from_name, 'from' => $from_email);
@dispatchEmail($verificationEmail);
if (empty($return_url)) {
if (isset($theForm)) {
示例2: replaceCustomFields
/**
* @param Subscriber $subscriber
* @param $email
*/
private function replaceCustomFields(Subscriber $subscriber, &$email)
{
$email['subject'] = Subscriber::replaceCustomFieldValues($email['subject'], $subscriber);
$email['htmlbody'] = Subscriber::replaceCustomFieldValues($email['htmlbody'], $subscriber);
$email['textbody'] = Subscriber::replaceCustomFieldValues($email['textbody'], $subscriber);
}