Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 10:47
    fabio
    0

    Mail template html problem

    Hello and thanks in advice
    First of all it's a great work.

    i'm working on the sending mail to the imported user.
    I need some info/help , because we need to send mail in html with a bit of style,
    i'm getting all the process of sending mail working prety fine, but it seem that
    all the content of the mail template is inserted as plain text, as example

    <STYLE TYPE="text/css"> body { background: #1D140F; color: #91807F; font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align: center; } table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;} tr { background: none repeat scroll 0 0 #130D0A; } th, td { border-style: solid;border-width: 1px;text-align: left;} td { border-color: #231A14;padding: 0.7em 1em; } th { background-color: #45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF; font-weight: bold; padding: 0.8em 1em; } h1, h2, h3, h4 { color: #F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; } h4 { font-size: 1.7em; } </STYLE> <center>A user account is created for you!<br/> Login with:<br/><br/> login:ITALIA3 pass:[pyz4-9<br/><br/> Have FUN!!


    is there any another place where do i have to setup the mail template?

    regards
    Fabio

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 12, 2011 @ 11:02
    Richard Soeteman
    0

    Hi Fabio,

    Thanks for your email.  There seems to be an encoding issue when editing throug the web interface when you want to use HTML. What you can do is is open the file /umbraco/plugins/CMSImport/Config/cmsImport.config then replace the mailCredentialsTemplate with the following and then it should work.

    <

     

     

    mailCredentialsTemplate>

    <

     

     

    STYLE TYPE="text/css">

    body { background: #1D140F; color: #91807F;

    font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align:

    center; } table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;} tr { background: none repeat scroll 0 0 #130D0A; } th, td { border-style: solid;border-width: 1px;text-align: left;} td {

    border-color: #231A14;padding: 0.7em 1em; } th { background-color:

    #45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF;

    font-weight: bold; padding: 0.8em 1em; } h1, h2, h3, h4 { color:

    #F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; } h4 { font-size:

    1.7em; }

    </

     

     

    STYLE>

    <

     

     

    center>

    A user account is created for you!

     

    <br/> Login with:<br/><br/> login:ITALIA3 pass:[pyz4-9<br/><br/> Have FUN!!

    </

     

     

    center>

    </

     

     

    mailCredentialsTemplate>


     

    Hope this helps you,

    Richard 

     

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 11:27
    fabio
    0

    Hi Richard, thanks for your fast answer

    now mail template is

     <mailCredentialsTemplate>

    <STYLE TYPE="text/css">

    body { background: #1D140F; color: #91807F;font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align:center; } 

    table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;} 

    tr { background: none repeat scroll 0 0 #130D0A; } 

    th, td { border-style: solid;border-width: 1px;text-align: left;} 

    td {border-color: #231A14;padding: 0.7em 1em; } 

    th { background-color:#45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF;font-weight: bold; padding: 0.8em 1em; } 

    h1, h2, h3, h4 { color:#F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; } 

    h4 { font-size:1.7em; }

    </STYLE>

    <center>

    <table>

    <tr><td colspan="2">blah blah blah, <br/> blah blah:</td></tr> 

    <tr><td>login:</td><td>[#loginname]</td></tr>

    <tr><td>Password:</td><td>[#password]</td></tr>

    </table>

     </center>

    </mailCredentialsTemplate> 

     

    BUt as resutl i'm getting

    body { background: #1D140F; color: #91807F;font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align:center; } table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;} tr { background: none repeat scroll 0 0 #130D0A; } th, td { border-style: solid;border-width: 1px;text-align: left;} td {border-color: #231A14;padding: 0.7em 1em; } th { background-color:#45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF;font-weight: bold; padding: 0.8em 1em; } h1, h2, h3, h4 { color:#F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; } h4 { font-size:1.7em; }blah blah blah, blah blah: login:admita3Password:Kl@W}]^

    Any idea?

     

    FAbio

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 12, 2011 @ 11:37
    Richard Soeteman
    0

    Ok so the style element doesn't get parsed in your email client. can't you use inline styling for the template?

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 11:44
    fabio
    0

    HI

    i have som doubt about that,

    from the same umbraco site i'm sending other emails with the same style and the same tag structure, all my client(i'm trying with different client to see how it looks)

    are displaying those mails well.

     i'm sending email with uCommerce, and with a custom macro.

    Fabio

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 12, 2011 @ 12:02
    Richard Soeteman
    0

    Weird and if you put an CData element around the HTML?

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 12:36
    fabio
    0

    Hi richard

    first of all, i didn't tried yet with CDATA.

    i'll do the test in the early afternoon,.

    To use inline style i'll have to insert at least the body tag, can i do it?

    OR the send mail code insert it?

    FAbio

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 13:00
    fabio
    0

    hi richard i've tried now with cdata and the following template, now the mail looks pretty good.

     <mailCredentialsTemplate>

    <![CDATA[

      <html>

      <head></head>

      <body>

    <STYLE TYPE="text/css">

    body { background: #1D140F; color: #91807F;font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align:center; } 

    table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;} 

    tr { background: none repeat scroll 0 0 #130D0A; } 

    th, td { border-style: solid;border-width: 1px;text-align: left;} 

    td {border-color: #231A14;padding: 0.7em 1em; } 

    th { background-color:#45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF;font-weight: bold; padding: 0.8em 1em; } 

    h1, h2, h3, h4 { color:#F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; } 

    h4 { font-size:1.7em; }

    </STYLE>

    <center>

    <table>

    <tr><td colspan="2">blah blah blah, <br/> blahblahblahblah :</td></tr> 

    <tr><td>login:</td><td>[#loginname]</td></tr>

    <tr><td>Password:</td><td>[#password]</td></tr>

    </table>

     </center>

      </body>

        </html>

        ]]>

    in the afternoon i'll do more test, and i'll send you back a final confirmation

    it think that CDATA and ading the html,body, etc... do the trick.

     

    many thanks.

     

    Fabio

     

    </mailCredentialsTemplate>

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 12, 2011 @ 13:05
    Richard Soeteman
    0

    HI Fabio,

    Great that it's working now. Yes please let me know if your final template works and also if I need to update the config file out of the box.

    Cheers,

    Richard

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 13:12
    fabio
    0

    hi richard

    i can immidiatly tell you a couple of things about the inline editing of the cofnig file,

    1. i don't know why, but all the template is displayed on 1 orw pressing enter has no effect on the text, but

       pressing enter you save the file.(al least using firefox 3.6 not tested on other browser)

    2. looking the config file in a text editor, after saving from umbraco admin gui looks like the following

      <mailCredentialsTemplate> &amp;lt;html&amp;gt;   &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;   &amp;lt;body&amp;gt; &amp;lt;STYLE TYPE="text/css"&amp;gt; body { background: #1D140F; color: #91807F;font: 10px 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 0; padding: 0; text-align:center; }   table { border-collapse: collapse; margin: 10px 5px;font-size:0.9em;}   tr { background: none repeat scroll 0 0 #130D0A; }   th, td { border-style: solid;border-width: 1px;text-align: left;}   td {border-color: #231A14;padding: 0.7em 1em; }   th { background-color:#45561B; border-color: #647C28 #586A22 #43511A #5A6F23; color: #FFFFFF;font-weight: bold; padding: 0.8em 1em; }   h1, h2, h3, h4 { color:#F0E8E8;font: bold 1em/1.5em 'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,Sans-Serif; margin: 3px 20px; }   h4 { font-size:1.7em; } &amp;lt;/STYLE&amp;gt; &amp;lt;center&amp;gt; &amp;lt;table&amp;gt; &amp;lt;tr&amp;gt;&amp;lt;td colspan="2"&amp;gt;blash blah....., &amp;lt;br/&amp;gt; blah blah:&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;   &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;login:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;[#loginname]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Password:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;[#password]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;  &amp;lt;/center&amp;gt;   &amp;lt;/body&amp;gt;     &amp;lt;/html&amp;gt;</mailCredentialsTemplate>

    loosing the cdata tag and as a consequence the mail layout is broken.

     

    Fabio

  • fabio 87 posts 107 karma points
    Jan 12, 2011 @ 14:06
    fabio
    0

    I?ve done some more test, now the html mail is display exactly as my other mails.

    so i mark the post solved.

    just a little feature request, i manage 7 languages on site i working on, having a template for each language code will be great.

    thanks for your help.

     

    Fabio 

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 12, 2011 @ 14:19
    Richard Soeteman
    0

    Thanks,

    I will add your feature request to the Backlog so it will come within a future release. Don't think it will be in 2.0 directly since that is already a huge release.

    Thanks,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft