You are here

function _pm_email_notify_user_level in Privatemsg 7.2

Same name and namespace in other branches
  1. 6.2 pm_email_notify/pm_email_notify.module \_pm_email_notify_user_level()

Retrieve notification level of a user.

This function retrieves user's pm notification level from database, if user preference doesn't exist - it uses default value instead.

Parameters

$uid: User ID.

Return value

Returns a PM_EMAIL_NOTIFY_LEVEL_* constant indicating the notification level of the requested user.

2 calls to _pm_email_notify_user_level()
pm_email_notify_form_user_profile_form_alter in pm_email_notify/pm_email_notify.module
Implements hook_form_FORM_ID_alter().
_pm_email_notify_send_check in pm_email_notify/pm_email_notify.module
Retrieve notification setting of a user and check if they should receive an e-mail notification for a message.

File

pm_email_notify/pm_email_notify.module, line 68
Notifies users about new Private Messages via Email.

Code

function _pm_email_notify_user_level($uid = NULL) {

  // Either check the setting for this user or the global default.
  if ($uid) {
    $keys = array(
      'user' => array(
        $uid,
      ),
      'global' => array(
        0,
      ),
    );
  }
  else {
    $keys = array(
      'global' => array(
        0,
      ),
    );
  }
  return privatemsg_get_setting('email_notify_level', $keys, PM_EMAIL_NOTIFY_LEVEL_ALL);
}