Commit bdad10a7 authored by visabhishek's avatar visabhishek Committed by jcnventura

Issue #2427639 by abarpetia, zealfire, visabhishek: User list in send by email

parent 719f08ce
......@@ -101,10 +101,10 @@ function print_mail_form_for_path($form, &$form_state, $path, $query = NULL, $us
$options = array();
if ($print_mail_user_recipients_default) {
if (module_exists('realname')) {
$sql = "SELECT u.mail, r.realname AS name from {users} u LEFT JOIN {realname} r ON u.uid = r.uid WHERE u.uid <> :uid ORDER BY name ASC";
$sql = "SELECT u.mail, r.realname AS name from {users} u LEFT JOIN {realname} r ON u.uid = r.uid WHERE u.uid <> :uid AND status = 1 ORDER BY name ASC";
}
else {
$sql = "SELECT mail, name from {users} WHERE uid <> :uid ORDER BY name ASC";
$sql = "SELECT mail, name from {users} WHERE uid <> :uid AND status = 1 ORDER BY name ASC";
}
$recipients = db_query($sql, array(':uid' => drupal_anonymous_user()->uid));
foreach ($recipients as $recipient) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment