Пример #1
0
function reservationSendMail()
{
    checkPerm('view');
    $lang =& DoceboLanguage::createInstance('reservation');
    $mod_perm = checkPerm('mod', true);
    $id_course = $_SESSION['idCourse'];
    $id_event = importVar('id_event', true, 0);
    $out = $GLOBALS['page'];
    $out->setWorkingZone('content');
    $man_res = new Man_Reservation();
    $acl_man =& Docebo::user()->getAclManager();
    if (isset($_POST['send_mail'])) {
        $recipients = $man_res->getEventUserMail($id_event);
        $subject = importVar('mail_object', false, '[Nessun Oggetto]');
        $body = importVar('mail_body', false, '');
        $info_user = $acl_man->getUser(getLogUserId());
        $sender = $info_user[ACL_INFO_EMAIL];
        //sendMail($recipients, $subject, $body, $sender);
        require_once _base_ . '/lib/lib.mailer.php';
        $mailer = DoceboMailer::getInstance();
        $mailer->SendMail($sender, $recipients, Lang::t('_MAIL_OBJECT', 'register'), $body, array(MAIL_REPLYTO => $sender, MAIL_SENDER_ACLNAME => false));
        Util::jump_to('index.php?modname=reservation&op=reservation&active_tab=events');
    } else {
        require_once _base_ . '/lib/lib.form.php';
        $out->add(getTitleArea($lang->def('_RESERVATION_MAIL_SEND') . '<div class="std_block">', 'content'));
        $out->add(Form::openForm('form_event', 'index.php?modname=reservation&amp;op=send_mail') . Form::openElementSpace() . Form::getTextfield($lang->def('_SUBJECT'), 'mail_object', 'mail_object', 255) . Form::getTextarea($lang->def('_MAIL_BODY'), 'mail_body', 'mail_body') . Form::getHidden('id_event', 'id_event', $id_event) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send_mail', 'send_mail', $lang->def('_SEND_MAIL')) . Form::getButton('undo_mail', 'undo_mail', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>');
    }
}