本文整理汇总了PHP中EmailTemplate::CreateBody方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::CreateBody方法的具体用法?PHP EmailTemplate::CreateBody怎么用?PHP EmailTemplate::CreateBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::CreateBody方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMail
// send buyer email
$emailTemplate->SetTemplate($settings['new_inquiry_seller_et']);
$sendSellerEmail = sendMail($listing_info->email, $email->Subject(), $email->CreateBody());
// send seller email
} else {
$db->query("INSERT INTO messages (parent_id,listing_id,from_id,to_id,message,timestamp) VALUES(0,'{$listing_id}','{$user_exists}','{$listing_info->id}','{$message}',NOW())");
$inquiry_id = $db->lastInsertedId();
// send an email to both parties
// send message notifications to inquirer and seller
$emailTemplate->SetParameter("inquirer_name", $name);
$emailTemplate->SetParameter("seller_name", $listing_info->first_name);
$emailTemplate->SetParameter("listing_headline", $listing_info->headline);
$emailTemplate->SetParameter("inquiry_message", $message);
$emailTemplate->SetParameter("inquiry_url", '<a href="http://www.businessfieds.com/inquiries/' . $inquiry_id . '">http://www.businessfieds.com/inquiry/' . $inquiry_id . '</a>');
$emailTemplate->SetTemplate($settings['new_inquiry_buyer_et']);
$sendBuyerEmail = sendMail($email, $emailTemplate->Subject(), $emailTemplate->CreateBody());
// send buyer email
$emailTemplate->SetTemplate($settings['new_inquiry_seller_et']);
$sendSellerEmail = sendMail($listing_info->email, $emailTemplate->Subject(), $emailTemplate->CreateBody());
// send seller email
}
// Send the user a message
?>
<div class="aligncenter" style="font-weight:bold;margin-top:30px;margin-bottom:30px">
Thank you! Your Inquiry Has Been Sent
You can view this inquiry in <a href="/myAccount">My Account</a>
</div>
<?php
}
示例2: DB
require "../includes/config.inc.php";
if (empty($db)) {
require_once "../classes/class.Database.php";
$db = new DB($db_name, $db_host, $db_user, $db_password);
}
require "../includes/functions.php";
require "../includes/session.php";
require_once "../classes/class.Template.php";
$emailTemplate = new EmailTemplate();
// Create an instance for new user from contact form
$thread_id = mysql_real_escape_string($_REQUEST['id']);
$listing_id = mysql_real_escape_string($_REQUEST['listing_id']);
$reply_content = mysql_real_escape_string($_REQUEST['replyContent']);
$to_id = mysql_real_escape_string($_REQUEST['to_id']);
$seller_id = $db->queryUniqueValue("SELECT to_id FROM messages WHERE id = '{$thread_id}'");
$listing_headline = $db->queryUniqueValue("SELECT headline FROM listings WHERE id = '{$listing_id}'");
$to = $db->queryUniqueObject("SELECT first_name, last_name, email FROM users WHERE id= '{$to_id}'");
if ($thread_id) {
$result = $db->query("INSERT INTO messages (parent_id, from_id, to_id, listing_id, message, timestamp) VALUES ('{$thread_id}','{$u_id}','{$to_id}','{$listing_id}','{$reply_content}', NOW())");
// send emails!
$emailTemplate->SetParameter("user_name", $to->first_name . ' ' . $to->last_name);
$emailTemplate->SetParameter("listing_headline", $listing_headline);
if ($to_id == $seller_id) {
$emailTemplate->SetParameter("inquiry_url", '<a href="http://businessfieds.com/myListing/' . $listing_id . '&inquiry_id=' . $thread_id . '#inquiry">http://www.businessfieds.com/myListing/' . $listing_id . '&inquiry_id=' . $thread_id . '#inquiry</a>');
} else {
$emailTemplate->SetParameter("inquiry_url", '<a href="http://businessfieds.com/myAccount&inquiry_id=' . $thread_id . '#inquiry">http://www.businessfieds.com/myAccount&inquiry_id=' . $thread_id . '#inquiry</a>');
}
$emailTemplate->SetTemplate($settings['inquiry_message_et']);
$sendBuyerEmail = sendMail($to->email, $emailTemplate->Subject(), $emailTemplate->CreateBody());
// send other party an email
}