Beispiel #1
0
function experimentmail__send_invitation_mail($mail, $part, $exp, $inv_text, $slist, $footer)
{
    global $settings;
    $part = experimentmail__get_invitation_mail_details($part, $exp, $slist);
    // split in subject and text
    $subject = stripslashes(str_replace(strstr($inv_text, "\n"), "", $inv_text));
    $mailtext = stripslashes(substr($inv_text, strpos($inv_text, "\n") + 1, strlen($inv_text)));
    $recipient = $part['email'];
    $message = process_mail_template($mailtext, $part) . "\n" . process_mail_template($footer, $part);
    $sender = experimentmail__get_sender_email($exp);
    $headers = "From: " . $sender . "\r\n";
    $done = experimentmail__mail($recipient, $subject, $message, $headers);
    $done2 = experimentmail__update_invited_flag($mail);
    return $done;
}
 echo '<TABLE class="or_formtable" style="width: 80%;">';
 echo '<TR><TD colspan=2>
         ' . button_link('experiment_mail_participants.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]));
     if ($experiment['experiment_type'] == "laboratory") {
         $sessionlist = experimentmail__get_session_list($experiment_id, $inv_lang);
     } else {
         $sessionlist = '';
     }
     $pform_fields = participant__load_participant_email_fields($inv_lang);
     $experimentmail = experimentmail__preview_fake_participant_details($pform_fields);
     $experimentmail = experimentmail__get_invitation_mail_details($experimentmail, $experiment, $sessionlist);
     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>';
     }