本文整理汇总了PHP中ArticleMailTemplate::sendWithParams方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::sendWithParams方法的具体用法?PHP ArticleMailTemplate::sendWithParams怎么用?PHP ArticleMailTemplate::sendWithParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleMailTemplate
的用法示例。
在下文中一共展示了ArticleMailTemplate::sendWithParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email
/**
* Email the comment.
* @param $recipients array of recipients (email address => name)
*/
function email($recipients)
{
$article = $this->article;
$articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
$journal =& Request::getJournal();
import('mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($article, 'SUBMISSION_COMMENT');
$email->setFrom($this->user->getEmail(), $this->user->getFullName());
$commentText = $this->getData('comments');
// Individually send an email to each of the recipients.
foreach ($recipients as $emailAddress => $name) {
$email->addRecipient($emailAddress, $name);
$paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => $commentText);
$email->sendWithParams($paramArray);
$email->clearRecipients();
}
}