コード例 #1
0
ファイル: experimentmail.php プロジェクト: danorama/orsee
function experimentmail__experiment_cancellation_mail($participant, $session)
{
    global $lang, $settings;
    // load experiment
    $experiment = orsee_db_load_array("experiments", $session['experiment_id'], "experiment_id");
    $maillang = experimentmail__get_language($participant['language']);
    // load laboratory
    $lab = laboratories__get_laboratory_text($session['laboratory_id'], $maillang);
    $pform_fields = participant__load_participant_email_fields($maillang);
    $experimentmail = experimentmail__fill_participant_details($participant, $pform_fields);
    $experimentmail = experimentmail__get_experiment_registration_details($experimentmail, $experiment, $session, $lab);
    $mailtext['subject'] = load_language_symbol('enrolment_cancellation_email_subject', $maillang);
    $mailtext['body'] = load_mail("public_experiment_enrolment_cancellation", $maillang);
    $message = process_mail_template($mailtext['body'], $experimentmail);
    $message = $message . "\n" . experimentmail__get_mail_footer($participant);
    $sendermail = experimentmail__get_sender_email($experiment);
    $headers = "From: " . $sendermail . "\r\n";
    experimentmail__mail($participant['email'], $mailtext['subject'], $message, $headers);
}
コード例 #2
0
    $session = experimentmail__preview_fake_session_details($experiment_id);
    if ($show_preview) {
        echo '<TABLE class="or_formtable" style="width: 80%;">';
        echo '<TR><TD colspan=2>						
			' . button_link('experiment_customize_enrol_conf.php?experiment_id=' . urlencode($experiment_id), lang('back_to_mail_page'), 'backward', 'font-size: 8pt;') . '
			</TD></TR>';
        foreach ($inv_langs as $inv_lang) {
            // split in subject and text
            $subject = str_replace(strstr($experiment_mail[$inv_lang], "\n"), "", $experiment_mail[$inv_lang]);
            $body = substr($experiment_mail[$inv_lang], strpos($experiment_mail[$inv_lang], "\n") + 1, strlen($experiment_mail[$inv_lang]));
            $lab = laboratories__get_laboratory_text($session['laboratory_id'], $inv_lang);
            $pform_fields = participant__load_participant_email_fields($inv_lang);
            $experimentmail = experimentmail__preview_fake_participant_details($pform_fields);
            $experimentmail['language'] = $inv_lang;
            $experimentmail = experimentmail__get_session_reminder_details($experimentmail, $experiment, $session, $lab);
            $experimentmail = experimentmail__get_experiment_registration_details($experimentmail, $experiment, $session, $lab, $inv_lang);
            if ($experiment['sender_mail']) {
                $sendermail = $experiment['sender_mail'];
            } else {
                $sendermail = $settings['support_mail'];
            }
            $email_text = process_mail_template(stripslashes($body), $experimentmail);
            if (count($inv_langs) > 1) {
                echo '<TR><TD colspan=2>
							<TABLE width="100%" border=0 class="or_panel_title"><TR>
							<TD style="background: ' . $color['panel_title_background'] . '; color: ' . $color['panel_title_textcolor'] . '">
								' . $inv_lang . ':
							</TD>
							</TR></TABLE>
						</TD></TR>';
            }