diff options
Diffstat (limited to 'h-source/Application/Include/params.php')
-rw-r--r-- | h-source/Application/Include/params.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php index ba4fef3..007a3f8 100644 --- a/h-source/Application/Include/params.php +++ b/h-source/Application/Include/params.php @@ -170,5 +170,33 @@ class Account $result = $mailer->batchSend($message); } - + + static public function sendWikiTalkNotice($who,$e_mails,$id_wiki) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $who = sanitizeAll($who); + $id_wiki = (int)$id_wiki; + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $wiki = new WikiModel(); + $pageUrl = $wiki->toWikiPage($id_wiki); + $talkUrl = "http://".DOMAIN_NAME."/wiki/talk/".Lang::$current."/$id_wiki"; + + $mess = "$who has added a message to the talk page of a wiki page you have contributed to maintain at $siteName\n\nThe whole conversation is here:\n\n".$talkUrl."\n\nThe wiki page is here:\n\n".$pageUrl."\n\nBest regards\nthe ".Website::$projectName." team\n\nP.S: you can disable the mail notifications in the profile page of your control panel"; + + $message = Swift_Message::newInstance()->setSubject("$who sent a notice to your attention")->setFrom(array($siteMail => $siteName))->setTo($e_mails)->setBody($mess); + + //Create the Transport + $transport = Swift_SmtpTransport::newInstance(Website::$mailServer, 25)->setUsername(Website::$generalMail)->setPassword(Website::$mailPassword); + + //Create the Mailer using your created Transport + $mailer = Swift_Mailer::newInstance($transport); + + //Send the message + $result = $mailer->batchSend($message); + + } }
\ No newline at end of file |