当前位置: 首页>>代码示例>>PHP>>正文


PHP EmailTemplate::Subject方法代码示例

本文整理汇总了PHP中EmailTemplate::Subject方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::Subject方法的具体用法?PHP EmailTemplate::Subject怎么用?PHP EmailTemplate::Subject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmailTemplate的用法示例。


在下文中一共展示了EmailTemplate::Subject方法的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 
}
开发者ID:andrewgai,项目名称:businessfieds,代码行数:31,代码来源:forms.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
}
开发者ID:andrewgai,项目名称:businessfieds,代码行数:31,代码来源:inquiryReply.php


注:本文中的EmailTemplate::Subject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。