Tembusan Email di osTicket v1.6 RC5

Ada beberapa pertanyaan di Forum Diskusi osTicket yang menanyakan mengenai CC Email di osTicket. Jika Anda ingin mengimplementasikan CC (Carbon Copy) atau Tembusan Email di osTicket v1.6 RC5, Anda dapat menerapkan modifikasi yang saya buat berikut. Saya memodifikasi file class.email.php yang terdapat di sub direktori \include\ dari Sistem osTicket.

  1. Buka file \include\class.email.php, dan cari kode ini:

    135
    
        function send($to,$subject,$message,$attachment=null) {

    lalu timpa dengan kode berikut:

    135
    
        function send($to,$subject,$message,$attachment=null,$cc='') {

    Cari lagi kode ini:

    161
    162
    163
    164
    165
    166
    167
    
            $headers = array ('From' => $from,
                              'To' => $to,
                              'Subject' => $subject,
                              'Message-ID' =>'<'.Misc::randCode(6).''.time().'-'.$this->getEmail().'>',
                              'X-Mailer' =>'osTicket v 1.6',
                              'Content-Type' => 'text/html; charset="UTF-8"'
                              );

    lalu timpa dengan kode berikut:

    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    
            if ($cc!='') {
              $headers = array ('From' => $from,
                              'To' => $to,
                              'Subject' => $subject,
                              'Cc' => $cc,
                              'Message-ID' =>'<'.Misc::randCode(6).''.time().'-'.$this->getEmail().'>',
                              'X-Mailer' =>'osTicket v 1.6',
                              'Content-Type' => 'text/html; charset="UTF-8"'
                              );
            } else {
              $headers = array ('From' => $from,
                              'To' => $to,
                              'Subject' => $subject,
                              'Message-ID' =>'<'.Misc::randCode(6).''.time().'-'.$this->getEmail().'>',
                              'X-Mailer' =>'osTicket v 1.6',
                              'Content-Type' => 'text/html; charset="UTF-8"'
                              );					
    	}
  2. Sekarang, jika Anda ingin menambahkan sebuah tembusan Email ketiika memanggil fungsi send() yang terdapat di file class.email.php, Anda dapat menggunakan kode berikut:

    $email->send($email_to,$subject,$body,null,$email_cc); // tanpa lampiran

    di mana $email_cc adalah variabel yang mengandung email yang valid yang ingin Anda tembuskan.

Semoga bermanfaat.

Share

3,776 kali dibacaCetak Artikel Ini Cetak Artikel Ini

Komentar

  1. bhupal mengatakan:

    hai this is not working can you please help me when this replying to ticket by staff

  2. Masino Sinaga mengatakan:

    Thanks for the feedback. I will re-check the code.

  3. Durga mengatakan:

    issue for me.

    behavior is…
    TO guy receives email, CC will not get email.
    but in received email (in TO guy inbox) it is showing the CC email in the email. we have verified the email address and it is correct.

  4. resmi satış sitesi mengatakan:

    $email->send($email_to,$subject,$body,null,$email_cc); // without attachment
    Where we need to use this code

    Thank you

  5. Melissa mengatakan:

    How can you add a BCC?

  6. kavlito mengatakan:

    I don’t understand this – where is this code supposed to go?

    2. Now, if you want to add a CC Email when calling that send function belongs to class.email.php, then you may use the following code, for example:

    $email->send($email_to,$subject,$body,null,$email_cc); // without attachment

    which $email_cc is a variable that contains of the valid email that you want to CC it.

Utarakan pikiran Anda

*


*