Page 1 of 3 123 LastLast
Results 1 to 10 of 25
Like Tree1Likes

Thread: Email template not showing in email

  1. #1
    jsm25 is offline Junior Member
    Join Date
    Sep 2011
    Posts
    5

    Default Email template not showing in email

    I have created some email templates but when I go to ‘compose’ a new email and then ‘Options’ ‘templates’ the templates are listed in the dropdown box but then I select any of the templates the text is not updated.

    I do get a message ‘Selecting this temp…’ first.

    In the text editor window I get some text ‘undefined’ after I have accepted the message above.

    Has anymore got any suggestions on what to try.


    John

  2. #2
    jsm25 is offline Junior Member
    Join Date
    Sep 2011
    Posts
    5

    Default Re: Email template not showing in email

    I have now checked the folder and file permissions and set them all to 777 just to test but I am still getting this ‘undefined’ error when I try to use a email template.

    Can anyone make some subjections on what to try next.

    John


    Ps: I have attached a screen short of the error on the email hope that helps. The error log is also empty
    Attached Images Attached Images  

  3. #3
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    I have this problem as well. Just came in after upgrading this evening from 6.1.0 to 6.1.7

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Email template not showing in email

    Can you check the logfile suagrcrm.log for any errors in conjunction with email_templates?
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  5. #5
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    I have this error as well.
    With php display_errors on, I get nothing to the screen.
    It does this on Chrome and IE
    I turned on script errors in IE but I did not get any messages
    I have - set recursively all privileges to 777 for testing purposes.
    This is a clean build from 6.3.1 (where the error occured first)
    and also exists under an upgrade to 6.4.0RC2

    Very frustrating

    It is the ony thing keeping me from going operational. I got IMAP working just fine.
    Only templates won't show.

    No errors to sugarcrm.log file

    I have used and upgraded SugarCRM since version 5.5.1RC, so I am pretty familiar with it.
    In this test envionment, I upgraded my database (on a separate baseline) to vs vs 6.3.1 and moved it over into this clean build via mysql (import) where I am seeing the problem.

  6. #6
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    I have discovered that if I do a QUICK REPAIR AND REBUILD after every email I send USING AN EMAIL TEMPLATE

    then,

    the next time I use a template (any template), the template loading works.

    Now - this is a HORRIBLE work around.

    The key is to understanding what has broken after I send an email using a template that requires QUICK REPAIR and REBUILD

    It is not browser dependent (as tested over my 2 browsers only), and is not dependent on the template used.

    Incidentally, I do not see "undefined" as shown in the above photos, I just see the grey-out email, with the "Selecting this template will overwrite...." block on top of it, which does not go away until I hit NO, and the template is NOT imported. Only the subject line.

  7. #7
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    The trick above works ONLY in the main EMAIL display (click compose)

    If you - elsewhere - in SugarCRM click the email link for a contact/lead, and try to compose an email, and load a template, you will get the following SCRIPT ERROR

    Error: 'document.getElementById(,,,)' is null or not an object.

    ------------------
    It is related to this code:
    text = decodeURI(encodeURI(json_objects['email_template_object']['fields']['body_html'])).replace(/<BR>/ig, '\n').replace(/<br>/gi, "\n").replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');

    document.getElementById("setEditor1").checked = false;

    SUGAR.email2.composeLayout.renderTinyMCEToolBar('1 ', 0);
    ---------------------
    So - setEditor1 is failing

  8. #8
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    PATCH TO FIX THE PROBLEM

    TO DO THIS I WENT BACK TO A WORKING FILE IN VERSION 5.5.2RC

    IN the /include/javascript directory, open Sugar_grp_quickcomp.js (quick compose emails)

    go down to the routine appendEmailTemplateJSON

    replace this code:
    ----- code to replace ----
    var idx = SE.composeLayout.currentInstanceId; // post increment

    // query based on template, contact_id0,related_to
    //jchi 09/10/2008 refix #7743
    if(json_objects['email_template_object']['fields']['subject'] != '' ) { // cn: bug 7743, don't stomp populated Subject Line
    document.getElementById('emailSubject' + idx).value = decodeURI(encodeURI(json_objects['email_template_object']['fields']['subject']));
    }
    var text = '';
    if(json_objects['email_template_object']['fields']['text_only'] == 1){
    text = "<p>" + decodeURI(encodeURI(json_objects['email_template_object']['fields']['body'])).replace(/<BR>/ig, '</p><p>').replace(/<br>/gi, "</p><p>").replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/'/gi,'\'').replace(/&quot;/gi,'"') + "</p>";
    document.getElementById("setEditor1").checked = true;
    SUGAR.email2.composeLayout.renderTinyMCEToolBar('1 ', 1);
    }
    else{
    text = decodeURI(encodeURI(json_objects['email_template_object']['fields']['body_html'])).replace(/<BR>/ig, '\n').replace(/<br>/gi, "\n").replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/'/gi,'\'').replace(/&quot;/gi,'"');
    document.getElementById("setEditor1").checked = false;
    SUGAR.email2.composeLayout.renderTinyMCEToolBar('1 ', 0);
    }
    ------ end of code to replace -----

    with this code

    --- replacement code ----
    var idx = SE.composeLayout.currentInstanceId; // post increment

    // query based on template, contact_id0,related_to
    //jchi 09/10/2008 refix #7743
    if(json_objects['email_template_object']['fields']['subject'] != '' ) { // cn: bug 7743, don't stomp populated Subject Line
    document.getElementById('emailSubject' + idx).value = decodeURI(encodeURI(json_objects['email_template_object']['fields']['subject']));
    }
    var text = '';
    var text = decodeURI(encodeURI(json_objects['email_template_object']['fields']['body_html'])).replace(/<BR>/ig, '\n').replace(/<br>/gi, "\n").replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/'/gi,'\'').replace(/&quot;/gi,'"');

    // cn: bug 14361 - text-only templates don't fill compose screen
    if(text == '') {
    text = decodeURI(encodeURI(json_objects['email_template_object']['fields']['body'])).replace(/<BR>/ig, '\n').replace(/<br>/gi, "\n").replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/'/gi,'\'').replace(/&quot;/gi,'"').replace(/\r\n/gi,"<br/>");

    //document.getElementById("setEditor1").checked = false;
    SUGAR.email2.composeLayout.renderTinyMCEToolBar('1 ', 0);
    }
    --- end of better code ----

    ANd, yes, the offending document.getElementByID call is commented out.

    Now I can use templates in my email.
    Last edited by gates2u; 2011-12-28 at 02:54 PM.
    MikeMcNuke likes this.

  9. #9
    gates2u is offline Sugar Community Member
    Join Date
    Feb 2010
    Location
    Greensboro MD
    Posts
    43

    Default Re: Email template not showing in email

    This problem might also have been corrected without the patch if I had fixed cache permissions first.

    See this post:
    http://www.sugarcrm.com/forums/f168/...ge-load-76949/

    Nonetheless, the patch works, and I'm not going to undo it now

  10. #10
    Pravo is offline Sugar Community Member
    Join Date
    Apr 2009
    Posts
    29

    Exclamation Re: Email template not showing in email

    It looks to only happen when you are in the Quick Compose. Clicking on their email address and trying to add a template doesn't work.

    Going to Email, compose email, adding their email address will allow you to load the template.

    Hope this bug gets fixed soon.

    These errors keep showing up:

    [29-Dec-2011 10:28:11] PHP Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in /home/include/JSON.php on line 68

    [29-Dec-2011 10:30:37] PHP Notice: Undefined index: e55107f7-962f-d0e5-bd31-4e37f958db7c in /home/modules/InboundEmail/InboundEmail.php on line 5920

    [29-Dec-2011 10:30:37] PHP Notice: Undefined index: e55107f7-962f-d0e5-bd31-4e37f958db7c in /home/modules/InboundEmail/InboundEmail.php on line 5921
    Last edited by Pravo; 2011-12-29 at 03:54 PM.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2010-12-07, 02:10 PM
  2. Replies: 0
    Last Post: 2009-06-04, 12:14 PM
  3. Replies: 3
    Last Post: 2009-02-24, 04:35 PM
  4. Replies: 3
    Last Post: 2007-03-13, 02:43 PM
  5. Replies: 1
    Last Post: 2005-05-02, 09:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •