Sugar 11.0.2: Email to case causes formatting to be incorrect

Hi,

An onpremise customer of ours got updated from 9.0.2 to 11.0.2 recently. One of the key features they use is the capability of importing e-mails and creating a case from it. We noticed a difference in how Sugar used to handle the creation of the case and how it is working since the upgrade. 

When we open the e-mail the body of the mail (description_html) seems to be fine and looks ok. When we open the created case on the other hand all seems to be scrambled and the HTML is not correctly converted as how it was in 9.0.2. The HTML contains a lot of tables. (it is a form submission converted to a table like structure to show it correctly in e-mail). As said, in the email it looks al correct because HTML is disabled. 

Did anyone notice this behaviour as well and if so how can we fix it? We already thought about a temporary solution by adding a description_html field in the cases module and copy the html from the email to the case when it is created and show the description / description_html field based on a checkbox. But that has its drawbacks also. 

Parents
  • I have had issues with html encoding in the Case description since v7.0 and it keeps coming back like a bad penny...

    The latest recurrence was Defect #(81812) which was fixed in 11.3  which, of course, is not available OnSite. 
    I asked for a hot fix but they could not give me one, and told me to wait for the upgrade to v12. 

    I've not upgraded to v12 yet for a series of reasons, not the least of which is I have to convert to Enterprise first and review all the customizations I did to add the features that Enterprise now has out of the box...

    I hope your customer's transition to v12 is easier than mine :)

Reply
  • I have had issues with html encoding in the Case description since v7.0 and it keeps coming back like a bad penny...

    The latest recurrence was Defect #(81812) which was fixed in 11.3  which, of course, is not available OnSite. 
    I asked for a hot fix but they could not give me one, and told me to wait for the upgrade to v12. 

    I've not upgraded to v12 yet for a series of reasons, not the least of which is I have to convert to Enterprise first and review all the customizations I did to add the features that Enterprise now has out of the box...

    I hope your customer's transition to v12 is easier than mine :)

Children
  • Thanks for the answer. Do you know or encountered any issues when converting the html and newlines are being broken in the past?

    For instance the issue we are currently facing is with the following text (without "):
    "Test Person"


    gets translated in the case to:
    "Test 
    Person" 


  • Dear Francesca,

    I am facing issue that my description contains formatted html data and while sending email to user programmatically,

    description field not formatted.

    My code:

    "

    $oTemplate = new EmailTemplate();
    $oMail = new SugarPHPMailer();
    $oEmailObj = new Email();
    $oTemplate->retrieve_by_string_fields(array('name' => "Template Name", 'type' => 'email'));
    $defaults = $oEmailObj->getSystemDefaultEmail();
    $oMail->From = $defaults['email'];
    $oMail->FromName = $defaults['name'];
    $oMail->ClearAllRecipients();
    $oMail->ClearReplyTos();
    $oMail->AddAddress($oUser->email1, $oUser->full_name);
    $test = $oUser->full_name;
    $oMail->Subject = parse_alert_template($oTask, $oTemplate->subject);
    $body = parse_alert_template($oTask, $oTemplate->body_html);
    $description = strip_tags($oTask->description);
    $body = str_replace('$task_description',$description,$body);
    $oMail->Body_html = from_html($body);
    $oMail->Body = wordwrap($body, 900);
    $oMail->Body = $body;
    $oMail->IsHTML(true);
    $oMail->prepForOutbound();
    $oMail->setMailerForSystem();

    "

    but this was working previously.

    Your help is appreciated.

    Thanks,

    Shreya