本文整理匯總了PHP中messenger::sendEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP messenger::sendEmail方法的具體用法?PHP messenger::sendEmail怎麽用?PHP messenger::sendEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類messenger
的用法示例。
在下文中一共展示了messenger::sendEmail方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: exec
public function exec($params = null)
{
$result = messenger::sendEmail($params['email'], $params['tmpl'], $params['content']);
if ($result['rsp'] == "succ") {
return true;
} else {
return false;
}
}
示例2: testSend
public function testSend()
{
$content = array('vcode' => rand(1000, 9999));
$email = "test@shopex.cn";
$m = messenger::sendEmail($email, 'account-member', $content);
if ($m['rsp'] == "fail") {
echo $m['err_msg'];
exit;
}
echo "發送郵件成功";
exit;
}
示例3: __implement
private function __implement($data)
{
$tmpl = 'user-item';
foreach ($data as $key => $value) {
$sendData['vcode'] = $value['vcode'];
$result = messenger::sendEmail($value['email'], $tmpl, $sendData);
if ($result['rsp'] == "fail") {
throw new \LogicException(app::get('sysitem')->_('郵件發送失敗'));
} else {
$params['gnotify_id'] = $value['gnotify_id'];
app::get('sysitem')->rpcCall('user.updatenotifyitem', $params);
}
}
return true;
}
示例4: send_email
public function send_email($type, $email, $content)
{
if (!($tmpl = $this->sendtypeToTmpl($type))) {
return false;
}
$vcodeData = $this->checkVcode($email, $type);
$vcode = $this->randomkeys(6);
$vcodeData['account'] = $email;
$vcodeData['vcode'] = $vcode;
$vcodeData['count'] = 1;
$vcodeData['createtime'] = date('Ymd');
$vcodeData['lastmodify'] = time();
$data['shopname'] = app::get('sysconf')->getConf('site.name');
$data['vcode'] = $content . "&vcode=" . $vcode;
$key = $this->getVcodeKey($email, $type);
$result = messenger::sendEmail($email, $tmpl, $data);
if ($result['rsp'] == "fail") {
throw new \LogicException(app::get('system')->_('郵件發送失敗,請檢查郵箱格式是否正確!'));
}
if (defined('WITHOUT_CACHE') && !constant('WITHOUT_CACHE')) {
cacheobject::set($key, $vcodeData, 3600 * 24);
} else {
base_kvstore::instance('vcode/account')->store($key, $vcodeData, 3600 * 24);
}
return true;
}