Exemplo n.º 1
0
             $from_name = $user->firstname . " " . $user->lastname . " (" . $user->username . ")";
         } else {
             $db_data->user_id = 0;
         }
         $db_data->timestamp = time();
     }
     $db->insertObject($db_data, 'formbuilder_' . $f->table_name);
 }
 //Email stuff here...
 //Don't send email if this is an edit.
 if ($f->is_email == 1 && !isset($_POST['data_id'])) {
     //Building Email List...
     $emaillist = array();
     foreach ($db->selectObjects("formbuilder_address", "form_id=" . $f->id) as $address) {
         if ($address->group_id != 0) {
             foreach (group::getUsersInGroup(group::getGroupById($address->group_id)) as $locUser) {
                 if ($locUser->email != '') {
                     $emaillist[] = $locUser->email;
                 }
             }
         } else {
             if ($address->user_id != 0) {
                 $locUser = user::getUserById($address->user_id);
                 if ($locUser->email != '') {
                     $emaillist[] = $locUser->email;
                 }
             } else {
                 if ($address->email != '') {
                     $emaillist[] = $address->email;
                 }
             }
Exemplo n.º 2
0
$headers = array("From" => $from = $config->email_from_reminder, "Reply-to" => $reply = $config->email_reply_reminder);
// set up the html message
$template->assign("showdetail", $config->email_showdetail);
$htmlmsg = $template->render();
// now the same thing for the text message
$msg = chop(strip_tags(str_replace(array("<br />", "<br>", "br/>"), "\n", $htmlmsg)));
// Saved.  do notifs
$notifs = unserialize($config->reminder_notify);
$emails = array();
foreach ($db->selectObjects('calendar_reminder_address', "calendar_id='" . $config->id . "'") as $c) {
    if ($c->user_id != 0) {
        $u = user::getUserById($c->user_id);
        $emails[] = $u->email;
    } else {
        if ($c->group_id != 0) {
            $grpusers = group::getUsersInGroup($c->group_id);
            foreach ($grpusers as $u) {
                $emails[] = $u->email;
            }
        } else {
            if ($c->email != '') {
                $emails[] = $c->email;
            }
        }
    }
}
if (empty($emails)) {
    print_r("<br><b><i>Exponent - " . gt('No One to Send Reminders to!') . "</i></b><br>");
    exit;
}
$emails = array_flip(array_flip($emails));