define ( 'NOTIFY_POKE', 0x0200 );
define ( 'NOTIFY_SHARE', 0x0400 );
+define ( 'SYSTEM_EMAIL', 0x4000 );
+
define ( 'NOTIFY_SYSTEM', 0x8000 );
/* @}*/
$body = sprintf($body, $error_message);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $admin['email'],
'preamble' => $preamble,
'body' => $body,
if (empty($sender_email))
$sender_email = t('noreply').'@'.$hostname;
- $user = dba::select('user', array('nickname', 'page-flags'),
+ if ($params['type'] != SYSTEM_EMAIL) {
+ $user = dba::select('user', array('nickname', 'page-flags'),
array('uid' => $params['uid']), array('limit' => 1));
- // There is no need to create notifications for forum accounts
- if (!dbm::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
- return;
+ // There is no need to create notifications for forum accounts
+ if (!dbm::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
+ return;
+ }
}
$nickname = $user["nickname"];
}
}
- if ($params['type'] == "SYSTEM_EMAIL") {
+ if ($params['type'] == SYSTEM_EMAIL) {
// not part of the notifications.
// it just send a mail to the user.
// It will be used by the system to send emails to users (like
// send email notification if notification preferences permit
if ((intval($params['notify_flags']) & intval($params['type']))
|| $params['type'] == NOTIFY_SYSTEM
- || $params['type'] == "SYSTEM_EMAIL") {
+ || $params['type'] == SYSTEM_EMAIL) {
logger('sending notification email');
call_hooks('enotify_mail', $datarray);
// check whether sending post content in email notifications is allowed
- // always true for "SYSTEM_EMAIL"
- $content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == "SYSTEM_EMAIL"));
+ // always true for SYSTEM_EMAIL
+ $content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
// load the template for private message notifications
$tpl = get_markup_template('email_notify_html.tpl');
$body = sprintf($body, $username, $sitename);
return notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration at %s'), $sitename),
'body' => $body));
$body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
return notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration details for %s'), $sitename),
'preamble'=> $preamble,
$body = sprintf($body, System::baseUrl(), $nu['email'], $result['password'], $a->config['sitename']);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $nu['email'],
'subject'=> sprintf(t('Registration details for %s'), $a->config['sitename']),
'preamble'=> $preamble,
$body = sprintf($body, $resetlink, System::baseUrl(), $email);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Password reset requested at %s'),$sitename),
'preamble'=> $preamble,
$body = sprintf($body, System::baseUrl(), $email, $new_password);
notification(array(
- 'type' => "SYSTEM_EMAIL",
+ 'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Your password has been changed at %s'),$sitename),
'preamble'=> $preamble,