Advertisement
Guest User

enable_attachments.patch

a guest
Feb 21st, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.34 KB | None | 0 0
  1. diff --git a/include/class.ticket.php b/include/class.ticket.php
  2. index 2619c62..3f55cf9 100644
  3. --- a/include/class.ticket.php
  4. +++ b/include/class.ticket.php
  5. @@ -1000,6 +1000,7 @@ class Ticket {
  6.                  && ($msg=$tpl->getNewTicketAlertMsgTemplate())) {
  7.  
  8.              $msg = $this->replaceVars($msg->asArray(), array('message' => $message));
  9. +            $attachments = $cfg->emailAttachments()?$message->getAttachments():array();
  10.  
  11.              $recipients=$sentlist=array();
  12.              //Exclude the auto responding email just incase it's from staff member.
  13. @@ -1009,7 +1010,7 @@ class Ticket {
  14.              //Alert admin??
  15.              if($cfg->alertAdminONNewTicket()) {
  16.                  $alert = $this->replaceVars($msg, array('recipient' => 'Admin'));
  17. -                $email->sendAlert($cfg->getAdminEmail(), $alert['subj'], $alert['body'], null, $options);
  18. +                $email->sendAlert($cfg->getAdminEmail(), $alert['subj'], $alert['body'], $attachments, $options);
  19.                  $sentlist[]=$cfg->getAdminEmail();
  20.              }
  21.  
  22. @@ -1035,7 +1036,7 @@ class Ticket {
  23.              foreach( $recipients as $k=>$staff) {
  24.                  if(!is_object($staff) || !$staff->isAvailable() || in_array($staff->getEmail(), $sentlist)) continue;
  25.                  $alert = $this->replaceVars($msg, array('recipient' => $staff));
  26. -                $email->sendAlert($staff, $alert['subj'], $alert['body'], null, $options);
  27. +                $email->sendAlert($staff, $alert['subj'], $alert['body'], $attachments, $options);
  28.                  $sentlist[] = $staff->getEmail();
  29.              }
  30.          }
  31. @@ -1741,10 +1745,11 @@ class Ticket {
  32.              }
  33.  
  34.              $sentlist=array(); //I know it sucks...but..it works.
  35. +           $attachments = $cfg->emailAttachments()?$message->getAttachments():array();
  36.              foreach( $recipients as $k=>$staff) {
  37.                  if(!$staff || !$staff->getEmail() || !$staff->isAvailable() || in_array($staff->getEmail(), $sentlist)) continue;
  38.                  $alert = $this->replaceVars($msg, array('recipient' => $staff));
  39. -                $email->sendAlert($staff, $alert['subj'], $alert['body'], null, $options);
  40. +                $email->sendAlert($staff, $alert['subj'], $alert['body'], $attachments, $options);
  41.                  $sentlist[] = $staff->getEmail();
  42.              }
  43.          }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement