Example #1
0
 /**
  * @return bool
  */
 public function sendEmail()
 {
     if (count($this->getRecipients()) > 0) {
         $this->setHeaders();
         email_users_id($this->getRecipients(), $this->getSubject(), $this->getBody(), $this->getHeaders());
     }
     return true;
 }
Example #2
0
            $mail_body2 .= msg('email_a_new_file_has_been_added') . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('label_filename') . ':  ' . $file_obj->getName() . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('label_status') . ': New' . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('date') . ': ' . $date . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('label_reviewer') . ': ' . $full_name . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('email_thank_you') . ',' . PHP_EOL . PHP_EOL;
            $mail_body2 .= msg('email_automated_document_messenger') . PHP_EOL . PHP_EOL;
            $mail_body2 .= $GLOBALS['CONFIG']['base_url'] . PHP_EOL . PHP_EOL;
            if (isset($_POST['send_to_all'])) {
                email_all($mail_subject, $mail_body2, $mail_headers);
            }
            if (isset($_POST['send_to_dept'])) {
                email_dept($dept_id, $mail_subject, $mail_body2, $mail_headers);
            }
            if (!empty($_POST['send_to_users'][0]) && is_array($_POST['send_to_users']) && $_POST['send_to_users'][0] > 0) {
                email_users_id($_POST['send_to_users'], $mail_subject, $mail_body2, $mail_headers);
            }
        } else {
            // If their user cannot authorize this file_id, display error
            header("Location:{$_SERVER['PHP_SELF']}?last_message=" . urlencode(msg('message_error_performing_action')));
        }
    }
    header('Location: out.php?last_message=' . urlencode(msg('message_file_authorized')));
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'comments' && isset($_REQUEST['id'])) {
    /*
     * Used to display the reviewer comments in a popup
     */
    $file_id = (int) $_REQUEST['id'];
    $file_obj = new FileData($file_id, $pdo);
    echo $file_obj->getReviewerComments();
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'Cancel') {