Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ solved ] issue for mail converter
#6
Apply this change and let me know if it makes a difference

Code:
diff --git a/modules/Settings/MailScanner/core/MailScannerAction.php b/modules/Settings/MailScanner/core/MailScannerAction.php
index 10ce017d9..969e39fd7 100644
--- a/modules/Settings/MailScanner/core/MailScannerAction.php
+++ b/modules/Settings/MailScanner/core/MailScannerAction.php
@@ -67,6 +67,10 @@ class Vtiger_MailScannerAction {
               }
       }

+       public function cleanUTF8($value) {
+               return function_exists('iconv') ? @iconv('UTF-8', 'UTF-8//IGNORE', $value) : $value;
+       }
+
       /**
        * Create/Update the information of Action into database.
        */
@@ -238,8 +242,8 @@ class Vtiger_MailScannerAction {
       public function __CreateTicket($mailscanner, $mailrecord) {
               global $adb;
               // Prepare data to create trouble ticket
-               $usetitle = $mailrecord->_subject;
-               $description = $mailrecord->getBodyText();
+               $usetitle = $this->cleanUTF8($mailrecord->_subject);
+               $description = $this->cleanUTF8($mailrecord->getBodyText());

               // There will be only on FROM address to email, so pick the first one
               $fromemail = $mailrecord->_from[0];
@@ -338,9 +342,9 @@ class Vtiger_MailScannerAction {
               $focus->column_fields['parent_type'] = $module;
               $focus->column_fields['activitytype'] = 'Emails';
               $focus->column_fields['parent_id'] = "$linkfocus->id@$relid|";
-               $focus->column_fields['subject'] = $mailrecord->_subject;
+               $focus->column_fields['subject'] = $this->cleanUTF8($mailrecord->_subject);

-               $focus->column_fields['description'] = $mailrecord->getBodyHTML();
+               $focus->column_fields['description'] = $this->cleanUTF8($mailrecord->getBodyHTML());
               $focus->column_fields['assigned_user_id'] = $linkfocus->column_fields['assigned_user_id'];
               $focus->column_fields['date_start'] = date('Y-m-d', $mailrecord->_date);
               $focus->column_fields['email_flag'] = 'MAILSCANNER';
Joe
TSolucio
Reply


Messages In This Thread
[ solved ] issue for mail converter - by rslemer - 05-03-2020, 04:58 PM
RE: issue for mail converter - by joebordes - 05-03-2020, 05:35 PM
RE: issue for mail converter - by rslemer - 05-04-2020, 07:03 PM
RE: issue for mail converter - by joebordes - 05-04-2020, 09:07 PM
RE: issue for mail converter - by rslemer - 05-04-2020, 10:35 PM
RE: issue for mail converter - by joebordes - 05-04-2020, 11:11 PM
RE: issue for mail converter - by rslemer - 05-05-2020, 04:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)