Advertisement
Guest User

Untitled

a guest
Jun 18th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. private function sendInvoiceReport($subject, $body)
  2. {
  3. // Initalize the message
  4. $message = \Swift_Message::newInstance()
  5. ->setSubject($subject)
  6. ->setFrom(array('noreply@fliinc.net' => 'FLI, INC'))
  7. ->setTo("tnovicoff@scotwoodindustries.com", "GBeal@scotwoodindustries.com", "sguerra@fliinc.net", "ALamendola@scotwoodindustries.com", "kfeldt@tekniq.com");
  8.  
  9.  
  10. $message->setBody($body, 'text/html');
  11.  
  12. // Send the message
  13. $this->getContainer()->get('mailer')->send($message);
  14.  
  15. // Manually flush the mail spooler because symfony is retarded
  16. $transport = $this->getContainer()->get('mailer')->getTransport();
  17. if (!$transport instanceof \Swift_Transport_SpoolTransport) {
  18. return;
  19. }
  20. $spool = $transport->getSpool();
  21. if (!$spool instanceof \Swift_MemorySpool) {
  22. return;
  23. }
  24. $spool->flushQueue($this->getContainer()->get('swiftmailer.transport.real'));
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement