本文整理汇总了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;
}