. */ class ApplicationMail { private $oldvalues; private $newvalues; private $newappl; private $appl_id; private $datenow; private $BodyCategory; public function __construct($oldvalues, $newvalues, $newappl, $appl_id) { $this->oldvalues = $oldvalues; $this->newvalues = $newvalues; #debugArray("oldvalues", $oldvalues); #debugArray("newvalues", $newvalues); $this->newappl = $newappl; $this->appl_id = $appl_id; $this->datenow = date("Y-m-d H:i:s"); $this->BodyCategory = ""; } public function __destruct() { } public function send() { global $setup; if( $this->newappl ) { if( $setup['InformMailParticipantNew'] ) $this->newToParticipant(); if( $setup['InformMailBoardNew'] ) $this->newToBoard(); if( $setup['InformMailOrganiserNew'] ) $this->newToOrganizer(); if( $setup['InformMailOrganiserVisaNew'] AND $this->newvalues['Visa invitation needed']=="Yes" ) $this->newToVisa(); $this->subscribeML($this->newvalues['Subscribe to AEGEE-L']=="Yes", $this->newvalues['Subscribe to AGORA-L']=="Yes", $this->newvalues['Subscribe to ANNOUNCE-L']=="Yes"); }elseif( strlen($this->getChangedInfo())>0 ) { if( $setup['InformMailParticipantEdit'] ) $this->editToParticipant(); if( $setup['InformMailBoardEdit'] ) $this->editToBoard(); if( $setup['InformMailOrganiserEdit'] ) $this->editToOrganizer(); if( $setup['InformMailOrganiserVisaEdit'] AND $this->newvalues['Visa invitation needed']=="Yes" ) $this->editToVisa(); } } private function getParticipantMail($newappl) { if( $newappl ) { return $this->newvalues['E-mail']; }else { if( $_SESSION['sess_name']==$this->oldvalues['username'] ) { // Participant did update his/her own application if( isset($this->newvalues['E-mail']) ) return $this->newvalues['E-mail']; elseif( isset($this->oldvalues['E-mail']) ) return $this->oldvalues['E-mail']; else return null; }else { // Participant did not update his/her own application if( isset($this->oldvalues['E-mail']) AND isset($this->newvalues['E-mail']) ) { if( $this->oldvalues['E-mail']==$this->newvalues['E-mail'] ) return $this->newvalues['E-mail']; else return array($this->oldvalues['E-mail'], $this->newvalues['E-mail']); }elseif( isset($this->oldvalues['E-mail']) ) return $this->oldvalues['E-mail']; elseif( isset($this->newvalues['E-mail']) ) return $this->newvalues['E-mail']; else return null; } } } private function getFrom() { global $setup; return "\"".$setup['SetupEventType']." Application Mailer\" <".$setup['EventApplFromEmail'].">"; } private function getBoard() { if( isset($this->newvalues['Body name']) ) $body = $this->newvalues['Body name']; else $body = $this->oldvalues['Body name']; $query="SELECT `Email`, `BodyCategory` FROM `ab_bodies` WHERE `BodyName`='".addslashes($body)."' OR `BodyNameAscii`='".addslashes($body)."'"; if( $row=@mysql_fetch_array( doquery($query) ) ) { $this->BodyCategory = $row['BodyCategory']; return array('mail' => $row['Email'], 'name' => $body); }else return null; } private function getNewInfo() { $k = array_keys($this->newvalues); $r = ""; for( $i=0; $inewvalues[ $k[$i] ]."\n"; } return rtrim(strip_tags($r)); } private function getChangedInfo() { $ko = array_keys($this->oldvalues); $kn = array_keys($this->newvalues); $r = ""; for( $i=0; $ioldvalues[ $kn[$i] ])>0 AND strlen($this->newvalues[ $kn[$i] ])>0 AND $this->oldvalues[ $kn[$i] ]!=$this->newvalues[ $kn[$i] ] ) { $r .= "\t".$kn[$i].": ".$this->oldvalues[ $kn[$i] ]." => ".$this->newvalues[ $kn[$i] ]."\n"; }elseif( strlen($this->oldvalues[ $kn[$i] ])>0 AND !(strlen($this->newvalues[ $kn[$i] ])>0) AND $this->oldvalues[ $kn[$i] ]!=$this->newvalues[ $kn[$i] ] ) { $r .= "\t".$kn[$i].": ".$this->oldvalues[ $kn[$i] ]." => [empty]\n"; }elseif( !(strlen($this->oldvalues[ $kn[$i] ])>0) AND strlen($this->newvalues[ $kn[$i] ])>0 AND $this->oldvalues[ $kn[$i] ]!=$this->newvalues[ $kn[$i] ] ) { $r .= "\t".$kn[$i].": [empty] => ".$this->newvalues[ $kn[$i] ]."\n"; } }elseif( strlen($this->newvalues[ $kn[$i] ])>0 ) { $r .= "\t".$kn[$i].": [N/A] => ".$this->newvalues[ $kn[$i] ]."\n"; } } return rtrim(strip_tags($r)); } private function newToParticipant() { global $setup, $ldap, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $this->getParticipantMail(true)) ) { $mail->setSubject(Mail::encodeHeader(utf8_decode("Application ".$setup['EventSubject']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode($this->newvalues['First name']." ".$this->newvalues['Family name']))."\" <".$this->newvalues['E-mail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "new to participant"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("new to participant", $this->appl_id)); if( isset($this->newvalues['First name']) ) $m = "Hi ".$this->newvalues['First name'].",\n\n"; else $m = "Hi ".$this->oldvalues['First name'].",\n\n"; $m .= "Thanks for applying for ".$setup['EventSubject'].", taking place from ".$setup['EventDateStart']." until ".$setup['EventDateEnd'].".\n\n"; $m .= "Please keep in mind that applying does not mean you are accepted. Until your name is published in the participants list, you are not accepted.\n\n"; if( (isset($this->newvalues['EventPre1']) && $this->newvalues['EventPre1']=="yes") || (isset($this->newvalues['EventPre2']) && $this->newvalues['EventPre2']=="yes") || (isset($this->newvalues['EventPre3']) && $this->newvalues['EventPre3']=="yes") || (isset($this->newvalues['EventPost1']) && $this->newvalues['EventPost1']=="yes") || (isset($this->newvalues['EventPost2']) && $this->newvalues['EventPost2']=="yes") || (isset($this->newvalues['EventPost3']) && $this->newvalues['EventPost3']=="yes") ) $m .= "Please keep in mind that you'll still have to apply for the pre and post event yourself, the option you selected was for informational and statistical use only.\n\n"; if( $setup['AuthSystem']=="None" ) $m .= "Please keep in mind that you cannot login and change your application any more. If you need to make changes, please contact the Chair Team via chair@aegee.org.\n\n"; else $m .= "In case you want to edit your application, log in with your ".$ldap->getSystemName()." account. Please keep in mind that after certain dates you are not able to edit all the data because of deadlines.\n\n"; $m .= "If you are not able to come, please cancel your application. This will free your place for other people that really want to come. Next to that, not showing up while being accepted "; $m .= "will be visible in the list of participants, and will negatively influence the number of people that can participate from your local for next Agora/EBM.\n\n"; $m .= "You filled in the following information:\n\n"; $m .= $this->getNewInfo()."\n\n"; $m .= "For questions, you can contact:\n\n".$setup['ContactInfo']; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was created by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to participant."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to participant (will be sent later)."); break; default: echoln("
Failed sending mail to participant."); } }else { echoln("
Failed sending mail to participant."); } } private function editToParticipant() { global $setup, $ldap, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $this->getParticipantMail(false)) ) { $mail->setSubject(Mail::encodeHeader(utf8_decode("Application ".$setup['EventSubject']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); if( isset($this->newvalues['First name']) ) $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode($this->newvalues['First name']." ".$this->newvalues['Family name']))."\" <".$this->newvalues['E-mail'].">"); else $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode($this->oldvalues['First name']." ".$this->oldvalues['Family name']))."\" <".$this->newvalues['E-mail'].">"); if( is_array($tomail = $this->getParticipantMail(false)) ) { if( isset($this->newvalues['First name']) ) $mail->addHeader("Cc", "\"".Mail::encodeHeader(utf8_decode($this->newvalues['First name']." ".$this->newvalues['Family name']))."\" <".$this->oldvalues['E-mail'].">"); else $mail->addHeader("Cc", "\"".Mail::encodeHeader(utf8_decode($this->oldvalues['First name']." ".$this->oldvalues['Family name']))."\" <".$this->oldvalues['E-mail'].">"); } $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "edit to participant"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("edit to participant", $this->appl_id)); if( isset($this->newvalues['First name']) ) $m = "Hi ".$this->newvalues['First name'].",\n\n"; else $m = "Hi ".$this->oldvalues['First name'].",\n\n"; $m .= "Thanks for updating your application for ".$setup['EventSubject'].", taking place from ".$setup['EventDateStart']." until ".$setup['EventDateEnd'].".\n\n"; $m .= "Please keep in mind that applying does not mean you are accepted. Until your name is published in the participants list, you are not accepted.\n\n"; if( (isset($this->newvalues['EventPre1']) && $this->newvalues['EventPre1']=="yes") OR (isset($this->newvalues['EventPre2']) && $this->newvalues['EventPre2']=="yes") OR (isset($this->newvalues['EventPre3']) && $this->newvalues['EventPre3']=="yes") OR (isset($this->newvalues['EventPost1']) && $this->newvalues['EventPost1']=="yes") OR (isset($this->newvalues['EventPost2']) && $this->newvalues['EventPost2']=="yes") OR (isset($this->newvalues['EventPost3']) && $this->newvalues['EventPost3']=="yes") ) $m .= "Please keep in mind that you'll still have to apply for the pre and post event yourself, the option you selected was for informational and statistical use only.\n\n"; if( $setup['AuthSystem']=="None" ) $m .= "Please keep in mind that you cannot login and change your application any more. If you need to make changes, please contact the Chair Team via chair@aegee.org.\n\n"; else $m .= "In case you want to edit your application, log in with your ".$ldap->getSystemName()." account. Please keep in mind that after certain dates you are not able to edit all the data because of deadlines.\n\n"; $m .= "The following information was changed:\n\n"; $m .= $this->getChangedInfo()."\n\n"; $m .= "For questions, you can contact:\n\n".$setup['ContactInfo']; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was updated by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to participant."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to participant (will be sent later)."); break; default: echoln("
Failed sending mail to participant."); } }else { echoln("
Failed sending mail to participant."); } } private function newToBoard() { global $setup, $ldap, $FULL_URL, $EVENTNUMID; $board = $this->getBoard(); if( $mail = new Mail($setup['MailReturnpath'], $board['mail']) ) { $mail->setSubject(Mail::encodeHeader(utf8_decode("A member applied for ".$setup['EventSubject']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode("Board ".$board['name']))."\" <".$board['mail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "new to board"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("new to board", $this->appl_id)); $m = "Hi board of ".$board['name'].",\n\n"; if( isset($this->newvalues['First name']) ) $m .= "One of your members (".$this->newvalues['First name']." ".$this->newvalues['Family name'].") applied for ".$setup['EventSubject'].", taking place from ".$setup['EventDateStart']." until ".$setup['EventDateEnd'].".\n\n"; else $m .= "One of your members (".$this->oldvalues['First name']." ".$this->oldvalues['Family name'].") applied for ".$setup['EventSubject'].", taking place from ".$setup['EventDateStart']." until ".$setup['EventDateEnd'].".\n\n"; if( $setup['SetupBoardApproval']=="yes" ) { if( $this->BodyCategory=="Contacts" ) { $m .= "Please go to https://".$FULL_URL."contacts.php, select the name of your Contact and fill in the password. This password you'll receive within one day after the first application has been made by one of your members to this e-mail address. You should assign every application observer (the representatives of your Contact) or visitor status. The number of observers is limited, meaning that some of your representatives will have to go as visitor. Until you do this, this person will not be accepted for the ".$setup['SetupEventType'].". The deadline to do so is ".$setup['EventDatePartTypeFix']." 23h59 ".date("T").".\n\n"; }elseif( $setup['PromoteAnonymousApplication'] ) { $m .= "Please go to http://".$FULL_URL."board.php and assign this person a participant type (delegate, envoy, visitor or observer). Select the name of your body and fill in the password. This password you'll receive within one day after the first application has been made by one of your members to this e-mail address. Please be patient, and don't complain within 24 hours you don't have the password. Until you confirm the application, this person will not be accepted for the ".$setup['SetupEventType'].". The deadline to do so is ".$setup['EventDatePartTypeFix']." 23h59 ".date("T").".\n\n"; }else { $m .= "Please go to http://".$FULL_URL."board.php and assign this person a participant type (delegate, envoy, visitor or observer). Every person of your body (local, project, working group) that is marked as board member can log in with his/her ".$ldap->getSystemName()." account to do this. Until you do this, this person will not be accepted for the ".$setup['SetupEventType'].". The deadline to do so is ".$setup['EventDatePartTypeFix']." 23h59 ".date("T").".\n\n"; } }else $m .= "Please inform the organizers of this event if this is not a member of your local. You can do this by simply replying to this e-mail, or using the contact information below.\n\n"; $m .= "Thanks for your cooperation.\n\n"; $m .= "All filled in data of this person:\n\n"; $m .= $this->getNewInfo()."\n\n"; $m .= "Contact information of the organizers:\n\n".$setup['ContactInfo']; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was created by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to board of participant."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to board of participant (will be sent later)."); break; default: echoln("
Failed sending mail to board of participant."); } }else { echoln("
Failed sending mail to board of participant."); } } private function editToBoard() { global $setup, $FULL_URL, $EVENTNUMID; $board = $this->getBoard(); if( $mail = new Mail($setup['MailReturnpath'], $board['mail']) ) { $mail->setSubject(Mail::encodeHeader(utf8_decode("Application of a member that applied for ".$setup['EventSubject']." changed (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode("Board ".$board['name']))."\" <".$board['mail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "edit to board"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("edit to board", $this->appl_id)); $m = "Hi board of ".$board['name'].",\n\n"; if( isset($this->newvalues['First name']) ) $m .= "The application of one of your members (".$this->newvalues['First name']." ".$this->newvalues['Family name'].") that applied for ".$setup['EventSubject']." changed.\n\n"; else $m .= "The application of one of your members (".$this->oldvalues['First name']." ".$this->oldvalues['Family name'].") that applied for ".$setup['EventSubject']." changed.\n\n"; if( $setup['SetupBoardApproval']=="yes" ) $m .= "Please go to http://".$FULL_URL."board.php and assign this person a participant type (delegate, envoy, visitor or observer). Until you do this, this person will not be accepted for the ".$setup['SetupEventType'].". The deadline to do so is ".$setup['EventDatePartTypeFix']." 23h59 ".date("T").".\n\n"; else $m .= "Please inform the organizers of this event if this is not a member of your local. You can do this by simply replying to this e-mail, or using the contact information below.\n\n"; $m .= "Thanks for your cooperation.\n\n"; $m .= "The following information was changed:\n\n"; $m .= $this->getChangedInfo()."\n\n"; $m .= "Contact information of the organizers:\n\n".$setup['ContactInfo']; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was changed by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to board of participant."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to board of participant (will be sent later)."); break; default: echoln("
Failed sending mail to board of participant."); } }else { echoln("
Failed sending mail to board of participant."); } } private function newToOrganizer() { global $setup, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $setup['EventApplEmail']) ) { if( isset($this->newvalues['First name']) ) $mail->setSubject(Mail::encodeHeader(utf8_decode("Application for ".$setup['EventSubject']." by ".$this->newvalues['First name']." ".$this->newvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); else $mail->setSubject(Mail::encodeHeader(utf8_decode("Application for ".$setup['EventSubject']." by ".$this->oldvalues['First name']." ".$this->oldvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode($setup['EventAppResponsible']))."\" <".$setup['EventApplEmail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "new to organizer"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("new to organizer", $this->appl_id)); $m = "Hi ".$setup['EventAppResponsible'].",\n\n"; $m .= "A new application was made for ".$setup['EventSubject'].".\n\n"; $m .= "The personal data of the applicant are:\n\n"; $m .= $this->getNewInfo()."\n\n"; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was created by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to local organizer."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to local organizer (will be sent later)."); break; default: echoln("
Failed sending mail to local organizer."); } }else { echoln("
Failed sending mail to local organizer."); } } private function editToOrganizer() { global $setup, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $setup['EventApplEmail']) ) { if( isset($this->newvalues['First name']) ) { $mail->setSubject(Mail::encodeHeader(utf8_decode("Changed application for ".$setup['EventSubject']." by ".$this->newvalues['First name']." ".$this->newvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); }else { $mail->setSubject(Mail::encodeHeader(utf8_decode("Changed application for ".$setup['EventSubject']." by ".$this->oldvalues['First name']." ".$this->oldvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); } $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode($setup['EventAppResponsible']))."\" <".$setup['EventApplEmail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "edit to organizer"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("edit to organizer", $this->appl_id)); $m = "Hi ".$setup['EventAppResponsible'].",\n\n"; $m .= "An application for ".$setup['EventSubject']." has been changed.\n\n"; $m .= "The following information was changed:\n\n"; $m .= $this->getChangedInfo()."\n\n"; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was changed by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to local organizer."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to local organizer (will be sent later)."); break; default: echoln("
Failed sending mail to local organizer."); } }else { echoln("
Failed sending mail to local organizer."); } } private function newToVisa() { global $setup, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $setup['EventApplVisaEmail']) ) { if( isset($this->newvalues['First name']) ) $mail->setSubject(Mail::encodeHeader(utf8_decode("Visa application for ".$setup['EventSubject']." by ".$this->newvalues['First name']." ".$this->newvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); else $mail->setSubject(Mail::encodeHeader(utf8_decode("Visa application for ".$setup['EventSubject']." by ".$this->oldvalues['First name']." ".$this->oldvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode("Visa responsible ".$setup['EventSubject']))."\" <".$setup['EventApplVisaEmail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "new to visa"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("new to visa", $this->appl_id)); $m = "Hi Visa Responsible,\n\n"; $m .= "A person who needs visa just applied for ".$setup['EventSubject'].".\n\n"; $m .= "The personal data of the applicant are:\n\n"; $m .= $this->getNewInfo()."\n\n"; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was created by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to visa responsible."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to visa responsible (will be sent later)."); break; default: echoln("
Failed sending mail to visa responsible."); } }else { echoln("
Failed sending mail to visa responsible."); } } private function editToVisa() { global $setup, $EVENTNUMID; if( $mail = new Mail($setup['MailReturnpath'], $setup['EventApplVisaEmail']) ) { if( isset($this->newvalues['First name']) ) $mail->setSubject(Mail::encodeHeader(utf8_decode("Changed visa application for ".$setup['EventSubject']." by ".$this->newvalues['First name']." ".$this->newvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); else $mail->setSubject(Mail::encodeHeader(utf8_decode("Changed visa application for ".$setup['EventSubject']." by ".$this->oldvalues['First name']." ".$this->oldvalues['Family name']." (ID ".$EVENTNUMID."-".sprintf("%04d", $this->appl_id).")"))); $mail->addHeader("To", "\"".Mail::encodeHeader(utf8_decode("Visa responsible ".$setup['EventSubject']))."\" <".$setup['EventApplVisaEmail'].">"); $mail->addHeader("From", $this->getFrom()); $mail->addHeader("X-Content", "edit to visa"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("edit to visa", $this->appl_id)); $m = "Hi Visa Responsible,\n\n"; $m .= "The application of a person who needs visa for ".$setup['EventSubject']." changed.\n\n"; $m .= "The following information was changed:\n\n"; $m .= $this->getChangedInfo()."\n\n"; if( $_SESSION['sess_uid']>0 ) $m .= "\n\n-- This application was changed by ".$_SESSION['sess_name']." --"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to visa responsible."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to visa responsible (will be sent later)."); break; default: echoln("
Failed sending mail to visa responsible."); } }else { echoln("
Failed sending mail to visa responsible."); } } private function subscribeML($aegeeL, $agoraL, $announceL) { global $setup; if( $aegeeL OR $agoraL OR $announceL ) { if( $mail = new Mail($setup['MailReturnpath'], $setup['ListservEmail']) ) { $mail->addHeader("To", "\"Listserv\" <".$setup['ListservEmail'].">"); $mail->addHeader("From", "\"".Mail::encodeHeader(utf8_decode($this->newvalues['First name']." ".$this->newvalues['Family name']." (".$this->newvalues['Body name'].")"))."\" <".$this->newvalues['E-mail'].">"); #$mail->addHeader("Subject", "Pretty useless subject to please the spam filter"); $mail->addHeader("X-Content", "subscribe lists"); $mail->addHeader("X-ApplicationID", $this->appl_id); $mail->addHeader("X-Signature", get_signature("subscribe lists", $this->appl_id)); $mail->setaddfooter(false); $m = "OK BEGIN\n"; $m .= "REG ".$this->newvalues['First name']." ".$this->newvalues['Family name']." (".$this->newvalues['Body name'].")\n"; if( $aegeeL ) $m .= "SUBSCRIBE AEGEE-L\n"; if( $agoraL ) $m .= "SUBSCRIBE AEGEE-AGORA-L\n"; if( $announceL ) $m .= "SUBSCRIBE ANNOUNCE-L\n"; $m .= "OK END\n"; #$m .= "\n"; #$m .= "* AEGEEserv is running a nice spam filter. Unfortunately this spam\n"; #$m .= "* filter considers mails with only listserv commands as spam. So, to\n"; #$m .= "* prevent this, we add some nonsense text. Where? You are reading it\n"; #$m .= "* right now. Isn't that fun? You are wasting your time reading some\n"; #$m .= "* text that is only there to fool the spam filter. Enjoy the rest of\n"; #$m .= "* your day.\n"; #$m .= "*\n"; #$m .= "* This nonsense was written by Wim"; $mail->setMessage($m); switch( $mail->send(true) ) { case Mail::MAIL_OK: echoln("
Send mail to listserv to subscribe to lists."); break; case Mail::MAIL_QUEUE: echoln("
Queued mail to listserv to subscribe to lists (will be sent later)."); break; default: echoln("
Failed sending mail to listserv to subscribe to lists."); } }else { echoln("
Failed sending mail to listserv to subscribe to lists."); } } } } ?>