Exemple #1
0
 public function sendChapterAnnouncementEmail(Announcement $_anc)
 {
     $_chapter = $_anc->getPoster()->getChapter();
     $_users = [];
     switch ($_anc->getWhoFor()) {
         case Announcement::WF_ACTIVES:
             $_users = User::findAllActiveBrothersForChapter($this->_pdo, $_chapter);
             break;
         case Announcement::WF_ASSOCIATES:
             $_users = User::findAllActiveAssociatesForChapter($this->_pdo, $_chapter);
             break;
         case Announcement::WF_BOTH:
             $_users = User::findAllActivesForChapter($this->_pdo, $_chapter);
             break;
     }
     foreach ($_users as $_user) {
         $this->send(self::$T_CHAPTER_ANNOUNCEMENT, $_user, ["NAME" => $_user->getNameFull(), "POSTER" => $_anc->getPoster()->getNameFull(), "POST_DATE" => $_anc->getDatePosted()->format("J d, Y"), "ANNOUNCEMENT_TEXT" => $_anc->getText()]);
     }
 }