diff options
Diffstat (limited to 'h-source/Application/Include/params.php')
-rw-r--r-- | h-source/Application/Include/params.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/h-source/Application/Include/params.php b/h-source/Application/Include/params.php index 7547643..1d3533b 100644 --- a/h-source/Application/Include/params.php +++ b/h-source/Application/Include/params.php @@ -141,5 +141,32 @@ class Account } } + + static public function sendTalkNotice($who,$e_mails,$id_hard) + { + require_once (ROOT.'/External/swiftmailer/lib/swift_required.php'); + + $who = sanitizeAll($who); + $id_hard = (int)$id_hard; + + $siteName = Website::$generalName; + $siteMail = Website::$generalMail; + + $urls = getUrlsFromIdHard($id_hard); + + $mess = "$who has added a message to the talk page of a device you have contributed to maintain at $siteName\n\nThe whole conversation is here:\n\n".$urls['urlTalk']."\n\nThe device page is here:\n\n".$urls['urlView']."\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 |