0

I have created a custom message template.

Custom Newsletter Campaign I followed this link https://doc.sitecore.com/developers/exm/90/email-experience-manager/en/walkthrough--building-a-custom-message-template.html

Now I wanted to perform A/B testing using the created message template.

This is how my template looks like

In A/B testing process we'll be providing different content and different styles in both A variants and B variants. For accomplishing that task I was using @Html.Sitecore().Placeholder("Image") this code. If I use this code I'm getting some unnecessary code snippets in the message variants. Like this enter image description here.Here is my layout code. Help me out with this.

<tbody>
<tr>
    <td class="email_bg bg_light px pt_md" data-bgcolor="Light" style="font-size: 0;text-align: center;line-height: 100%;background-color: #ffffff;padding-left: 16px;padding-right: 16px;padding-top: 32px;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">

        <table class="content_section" role="presentation" align="center" width="100%" cellspacing="0" cellpadding="0" border="0" style="max-width: 800px;margin: 0 auto;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
            <tbody>
                <tr>
                    <td class="content_cell bg_white brounded_top bt_primary px py_md bg_center" data-bgcolor="White" data-border-top-color="Border Primary" data-bg="BG Shoes" style="font-size: 0px; text-align: center; background-color: #ffffff; border-top: 4px solid rgb(35, 118, 220); background-repeat: no-repeat; background-position: 50% 0px; border-radius: 4px 4px 0px 0px; padding: 32px 16px; text-size-adjust: 100%;">
                        @Html.Sitecore().Placeholder("subHeader")
                        <div class="column_row" style="font-size: 0;text-align: center;max-width: 624px;margin: 0 auto;">

                            <table class="column" role="presentation" align="center" width="100%" cellspacing="0" cellpadding="0" border="0" style="vertical-align: top;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
                                <tbody>
                                    <tr>
                                        <td class="column_cell px pt_md text_dark text_center editable" data-color="Dark" style="vertical-align: top;color: #333333;text-align: center;padding-left: 16px;padding-right: 16px;padding-top: 32px;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;" contenteditable="false">
                                            <h1 class="mt mb_xs" style="color: inherit;font-family: Arial, Helvetica, sans-serif;margin-top: 16px;margin-bottom: 8px;word-break: break-word;font-size: 38px;line-height: 48px;font-weight: bold;">HOT DEALS</h1>
                                            <h3 class="mb text_primary" data-color="Primary" style="color: #2376dc;font-family: Arial, Helvetica, sans-serif;margin-top: 0px;margin-bottom: 16px;word-break: break-word;font-size: 21px;line-height: 28px;font-weight: bold;">Get 50% off + Free Shipping!</h3>
                                            @Html.Sitecore().Placeholder("Image")

                                            <p class="mb_xs img_inline" style="color: inherit;font-family: Arial, Helvetica, sans-serif;margin-top: 0px;margin-bottom: 8px;word-break: break-word;font-size: 16px;line-height: 100%;clear: both;">
                                                <img src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2017/10/15/qgIPe3wEBH4nTWOL2AmKSGoR/ecommerce_footwear/images/color_thumb.png" width="16" height="16" alt="" style="max-width: 16px;-ms-interpolation-mode: bicubic;border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;"> &nbsp;
                                                <img src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2017/10/15/qgIPe3wEBH4nTWOL2AmKSGoR/ecommerce_footwear/images/color_thumb_2.png" width="16" height="16" alt="" style="max-width: 16px;-ms-interpolation-mode: bicubic;border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;"> &nbsp;
                                                <img src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2017/10/15/qgIPe3wEBH4nTWOL2AmKSGoR/ecommerce_footwear/images/color_thumb_3.png" width="16" height="16" alt="" style="max-width: 16px;-ms-interpolation-mode: bicubic;border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;"> &nbsp;
                                                <img src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2017/10/15/qgIPe3wEBH4nTWOL2AmKSGoR/ecommerce_footwear/images/color_thumb_4.png" width="16" height="16" alt="" style="max-width: 16px;-ms-interpolation-mode: bicubic;border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;"> &nbsp;
                                                <img src="http://www.stampready.net/dashboard/editor/user_uploads/zip_uploads/2017/10/15/qgIPe3wEBH4nTWOL2AmKSGoR/ecommerce_footwear/images/color_thumb_5.png" width="16" height="16" alt="" style="max-width: 16px;-ms-interpolation-mode: bicubic;border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;">
                                            </p>
                                            @Html.Sitecore().Placeholder("Price")
                                            <table role="presentation" class="ebutton" align="center" border="0" cellspacing="0" cellpadding="0" style="-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;margin: 0 auto;">
                                                <tbody>
                                                    <tr>
                                                        <td class="bg_primary" data-bgcolor="Primary" style="background-color: #2376dc;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 0pt;mso-table-rspace: 0pt;font-size: 16px;padding: 13px 24px;border-radius: 4px;line-height: normal;text-align: center;font-weight: bold;-webkit-transition: box-shadow .25s;transition: box-shadow .25s;" contenteditable="true"><a href="#" data-color="White" style="-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;text-decoration: none;color: #2376dc;font-family: Arial, Helvetica, sans-serif;margin-top: 0px;margin-bottom: 0px;word-break: break-word;font-weight: bold;" class="editable" contenteditable="true"><span data-color="White" style="color: #ffffff;text-decoration: none;" contenteditable="false" class="editable">Get This Offer</span></a></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <p class="mt_md text_xs text_secondary" data-color="Secondary" style="color: #959ba0;font-family: Arial, Helvetica, sans-serif;margin-top: 32px;margin-bottom: 0px;word-break: break-word;font-size: 14px;line-height: 22px;">City Racer Men Sneakers Maecenas Pharetra Condimentum Lectus.</p>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

                        </div>
                    </td>
                </tr>
            </tbody>
        </table>

    </td>
</tr>

Can't able to add any other variants

  • are using binding the layout with new template? the example you are seeing is using .aspx file for the layout, are you using the same? – Mahendra Shekhawat Sep 24 at 14:20
  • Ya i'm binding the layout with new template. But instead of aspx file i'm using cshtml file. – kohila vani Sep 24 at 14:30
  • the most common cause of this type of issues is not well-formatted HTML, could you please ensure all attribute values include both opening and closing quote characters, also if possible can share the layout code? Are you using specific conditional css classes for IE? – Mahendra Shekhawat Sep 24 at 14:50
  • Please check my layout code. – kohila vani Sep 25 at 6:09
0

From the above code, it looks your Layout structure is not proper. Your layout item should point to a file with well-structured HTML code something like this -

<html>
<head>
  <!--- Head section-->
</head>
<body>
  <!-- Body section-->
</body>
<html>

All you <tbody> code will be part of the Body section.

  • Ya.. What you said is right. Now i'm getting proper message template. But i'm facing new issue now. I can't able to add one more variant.Please check the screen shot. – kohila vani Sep 25 at 7:26
  • Your message template should be inherited from "Templates/System/Email/Messages/AB Testable Message", I have not tried it but you can try by inheriting it in your custom message template – Mahendra Shekhawat Sep 25 at 7:45
  • Already i'm inheriting from AB test message only /sitecore/templates/System/Email/Messages/AB Test Message – kohila vani Sep 25 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.