本文整理汇总了PHP中FormMail::send方法的典型用法代码示例。如果您正苦于以下问题:PHP FormMail::send方法的具体用法?PHP FormMail::send怎么用?PHP FormMail::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormMail
的用法示例。
在下文中一共展示了FormMail::send方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendForm
/**
* This is the base function for sending mail;
* it looks up the form, and fills in the params,
* then calls mail.
*/
public function sendForm($to, array $params = NULL)
{
try {
$sendBody = $this->body;
if (!is_null($params)) {
if (count($this->paramNames) != count($params)) {
logMessage('FormMail.sendForm(' . $to . ')', 'params do not match');
}
$sendBody = $this->body;
foreach ($this->paramNames as $param) {
$sendBody = str_replace($param, $params[$param], $sendBody);
}
}
FormMail::send($to, $this->subject, $sendBody);
} catch (Exception $ex) {
logMessage('FormMail.sendForm(' . $to . ')', $ex->getMessage());
}
}
示例2: swwat_parse_string
$message = swwat_parse_string(html_entity_decode($_POST[PARAM_MESSAGE]));
$list = $_POST[PARAM_LIST_INDEX];
if (!is_null($list) && ($typeFlag && (!is_null($subject) || !is_null($message)) || !$typeFlag && !is_null($message))) {
if (!$typeFlag) {
$subject = "";
// ensure blank
$message = substr($message, 0, 160);
}
$workerList = $_SESSION[PARAM_LIST];
for ($k = 0; $k < count($list); $k++) {
try {
$listIndex = swwat_parse_number(html_entity_decode($list[$k]), FALSE);
$worker = $workerList[$listIndex];
$to = $typeFlag ? $worker->email : $worker->smsemail;
if (!is_null($to) && strlen($to) > 0) {
FormMail::send($to, $subject, $message);
} else {
/* continue to process list */
logMessage("SendMessageAction", "failure with to field:" . $to . " index:" . $k . " value:" . $list[$k]);
}
} catch (ParseSWWATException $pe) {
/* continue to process list */
logMessage("SendMessageAction", "failure with index:" . $k . " value:" . $list[$k]);
}
}
// $k
}
// all null
// return to whence we came
if (is_null(getStationCurrent())) {
if (is_null(getExpoCurrent())) {
示例3: foreach
// create data array
// loop over array of emails
foreach ($email_array as $email) {
$messages = $messagedata[$email];
$subject = $messages[0]->expo . " Reminder";
$message = "Dear " . $messages[0]->workerName . ",\n\n";
if (PARAM_ANTEREMINDER_TIME == 1) {
$message .= "This message is to remind you that your upcoming shift assignment for " . PARAM_ANTEREMINDER_TIME . " day from now is:\n\n";
} else {
$message .= "This message is to remind you that your upcoming shift assignment for " . PARAM_ANTEREMINDER_TIME . " days from now is:\n\n";
}
$message .= "Expo: " . $messages[0]->expo . "\n\n";
$body = $message;
foreach ($messages as $message) {
$body .= "Station: " . $message->station . "\n";
$shift = explode(';', swwat_format_shift($message->startTime, $message->stopTime));
$body .= "Time: " . $shift[0] . " (" . $shift[1] . ")\n";
}
// $message
//START SIGNATURE BLOCK
$message .= "\n\n Your participation in the conference is appreciated.";
// $message .= "\n\n Please notify us at zzz-xxx-yyyy if unable to make your shift.";
$message .= "\n\n Thank you,";
$message .= "\n\n Your " . SITE_NAME . " Team";
// ENDIT SIGNATURE BLOCK
FormMail::send($email, $subject, $body);
logMessage("SendMessagesCron", "email sent to " . $email);
}
// $email
ReminderSent::insert(swwat_format_isodate($targtag));
logMessage("SendMessagesCron", "Date: " . swwat_format_isodate($targtag) . " written to database.");