Esempio n. 1
0
 //  $mail->FromName = $name;
 $mail->FromName = $_SESSION['GO_SESSION']["name"];
 $mail->AddReplyTo($_SESSION['GO_SESSION']["email"], $_SESSION['GO_SESSION']["name"]);
 $mail->WordWrap = 50;
 $mail->IsHTML(true);
 $mail->Subject = sprintf($subjectEventInvitation, $name);
 require_once $GO_MODULES->class_path . 'go_ical.class.inc';
 $ical = new go_ical();
 $ics_string = $ical->export_event($event_id);
 if ($ics_string) {
     $mail->AddStringAttachment($ics_string, $name . '.ics', 'base64', 'text/calendar');
 }
 for ($i = 0; $i < sizeof($participants); $i++) {
     $id = 0;
     if ($ab_module) {
         $user_profile = $ab->get_contact_profile_by_email(smart_addslashes($participants[$i]), $GO_SECURITY->user_id);
         $id = $user_profile["source_id"];
     } else {
         $user_profile = false;
     }
     if (!$user_profile) {
         $user_profile = $GO_USERS->get_profile_by_email(smart_addslashes($participants[$i]));
         $id = $user_profile["id"];
     }
     if ($user_profile) {
         $middle_name = $user_profile['middle_name'] == '' ? '' : $user_profile['middle_name'] . ' ';
         $profile_name = $user_profile['first_name'] . ' ' . $middle_name . $user_profile['last_name'];
     } else {
         $profile_name = $participants[$i];
     }
     if ($id == 0) {