Show
Ignore:
Timestamp:
03/10/08 21:57:32 (5 years ago)
Author:
d0nut
Message:

added the mailer to buddyloo

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • buddyloo/files/lib/form/InvitationEditForm.class.php

    r270 r312  
    1515class InvitationEditForm extends AbstractForm { 
    1616        public $input = ''; 
     17        public $body = ''; 
    1718        public $inputArray = array(); 
    1819        public $emails = array(); 
     
    5051                 
    5152                if (isset($_POST['input'])) $this->input = StringUtil::trim($_POST['input']); 
     53                if (isset($_POST['body'])) $this->body = StringUtil::trim($_POST['body']); 
    5254        } 
    5355         
     
    9193                // reset input field 
    9294                $this->input = ''; 
     95                $this->body = ''; 
    9396                 
    9497                // show success message 
     
    177180                } 
    178181        } 
     182         
     183        /** 
     184         * Sends the email notification for recipients. 
     185         */ 
     186        protected function sendNotification() { 
     187                require_once(WCF_DIR.'lib/data/mail/Mail.class.php'); 
     188                 
     189                // send notifications 
     190                foreach ($this->inputArray as $recipient) { 
     191                        // send mail 
     192                        $subjectData = array( 
     193                                '$author' => WCF::getUser()->username, 
     194                                'PAGE_TITLE' => PAGE_TITLE 
     195                        ); 
     196                        $messageData = array( 
     197                                'PAGE_TITLE' => PAGE_TITLE, 
     198                                '$recipient' => $recipient->username, 
     199                                '$author' => WCF::getUser()->username, 
     200                                '$pageurl' => FileUtil::addTrailingSlash(PAGE_URL), 
     201                                '$notice' => (REGISTER_INVITATIONS ? WCF->getLanguage()->get('wcf.buddyloo.invitation.register_invitation') : ""), 
     202                                '$body' => $this->body 
     203                        ); 
     204 
     205                        $mail = new Mail(array($recipient->email), WCF->getLanguage()->get('wcf.buddyloo.invitation.subject', $subjectData), WCF->getLanguage()->get('wcf.buddyloo.invitation.body', $messageData)); 
     206                        $mail->send(); 
     207                } 
     208        } 
    179209} 
    180210?>