Exemple #1
0
 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients)
 {
     $paper = $this->paper;
     $paperCommentDao =& DAORegistry::getDAO('PaperCommentDAO');
     $schedConf =& Request::getSchedConf();
     import('classes.mail.PaperMailTemplate');
     $email = new PaperMailTemplate($paper, 'SUBMISSION_COMMENT');
     $email->setFrom($this->user->getEmail(), $this->user->getFullName());
     $commentText = $this->getData('comments');
     // Individually send an email to each of the recipients.
     foreach ($recipients as $emailAddress => $name) {
         $email->addRecipient($emailAddress, $name);
         $paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => $commentText);
         $email->sendWithParams($paramArray);
         $email->clearRecipients();
     }
 }