SOLVED

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

Go to solution
RootreeCory
Level 1

How do "mktoActive" and "mktoAddByDefault" actually work?

Hello,

Hopefully I have selected the right post location for this.

I've seen a few community posts on this, but I have not yet been able to wrap my head around it with those resources.

 

I am creating an email template and I am having trouble understanding "mktoActive" and "mktoAddByDefault" and how they work together.

 

My goal is to have all of my modules in the sidebar/Modules tab, and then also have a few of those on the "canvas" when an email is created from our templates.

 

For example, I have a module that I want to be listed in Modules tab and also NOT display on a newly created email using this template.
Here is the markup I currently have:

<tr class="mktoModule" id="module-name" mktoName="Module Name" mktoActive="true" mktoAddByDefault="false">

With this, the module is not added on creation, but also not in the Modules sidebar tab.

 

What I found in the documentation:

  • mktoActive: Determines whether this module appears in the list of modules within the email editor. Defaults to true. If false, the module cannot be added by an end user to an email.
  • mktoAddByDefault: Determines whether this module will be in the canvas of a new email that uses this template upon creation. Defaults to true (if mktoActive is false, this value is ignored).

From my understanding, the mktoActive attribute determines if the module appears in the modules tab in the sidebar and the mktoAddByDefault attribute determines if the module should display in an email using this template at creation. (true=visible, false=hidden, for both)

 

I had originally just omitted mktoActive, set mktoAddByDefault to true or false (depending on the module) and when I was adding my code to my design studio email it did reflect what I needed.

Once I created a template and then created a new email out of that template... the modules that weren't on the "canvas" were not in the sidebar Modules tab either. (the ones that exited on the canvas were in the Modules tab)

<tr class="mktoModule" id="module-name" mktoName="Module Name" mktoAddByDefault="false">

 

What am I understanding/doing wrong? 😅

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Dave_Roberts
Level 10

Re: How do "mktoActive" and "mktoAddByDefault" actually work?


From my understanding, the mktoActive attribute determines if the module appears in the modules tab in the sidebar and the mktoAddByDefault attribute determines if the module should display in an email using this template at creation. (true=visible, false=hidden, for both)

From my experience, your understanding of this is correct. I'll generally omit the mktoActive attribute b/c I rarely run into a situation where you'd want to include a module but omit it from the sidebar -- maybe a use case for this would be to force a header or footer onto the page but not be able to add another?

 

Here's the matrix of how I've seen these work in combination:
mktoActive = TRUE, mktoAddByDefault = TRUE: This should include the module on the canvas AND in the sidebar 

mktoActive = FALSE, mktoAddByDefault = TRUE: This should include the module on the canvas BUT NOT in the sidebar

mktoActive = TRUE, mktoAddByDefault = FALSE: This should NOT include the module on the canvas but include it in the sidebar

mktoActive = FALSE, mktoAddByDefault = FALSE: This should NOT include the module on the canvas NOR in the sidebar

 

It sounds like you've got this setup correctly but are still seeing an issue with the modules being displayed as you'd expect them to. Is there a chance you could share your email code using the syntax highlighter here (Click HTML button in the toolbar then the </> button to add code). 

 

Sight unseen, the only thing I could think of that might cause something like this to happen is if the modules were all NOT nested in the same class="mktoContainer" (which I would assume is a table based on your markup). Here's a link to the docs for the containers: https://experienceleague.adobe.com/docs/marketo/using/product-docs/email-marketing/general/email-edi... -- this has a warning that you can only use one main container so maybe if they were in different containers something like this might occur?

 

Alternately, something might have gotten funny while you were working on the email template code -- a lot of times I'll hit the "Preview" button before the code is actually saved and the changes that I made (which are unsaved) don't end up sticking even though they show in the code editor. You might try copying your code from the existing template and spinning up new template and pasting the code in there. Wait for the "Auto-Saving" thing in the top right corner to do it's thing and then approve the template and try making an Email asset and see if you get any different results?

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

If @Dave_Roberts sees this we’ll get the best answer about such Email Editor quirks.

Jasbir_Kaur
Level 5

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

Hi @RootreeCory,

 

If you want the modules in the sidebar/Modules tab, and then also have a few of those on the "canvas" when an email is created from the templates, then you just need to use mktoAddByDefault.

Where you will use the mktoAddByDefault="false" it will hide those modules from the canvas and show in the sidebar menu only, and you can easily drag these modules in the emails.

 

Let me know if anything is not clear.

 

Thanks!

Jasbir

Dave_Roberts
Level 10

Re: How do "mktoActive" and "mktoAddByDefault" actually work?


From my understanding, the mktoActive attribute determines if the module appears in the modules tab in the sidebar and the mktoAddByDefault attribute determines if the module should display in an email using this template at creation. (true=visible, false=hidden, for both)

From my experience, your understanding of this is correct. I'll generally omit the mktoActive attribute b/c I rarely run into a situation where you'd want to include a module but omit it from the sidebar -- maybe a use case for this would be to force a header or footer onto the page but not be able to add another?

 

Here's the matrix of how I've seen these work in combination:
mktoActive = TRUE, mktoAddByDefault = TRUE: This should include the module on the canvas AND in the sidebar 

mktoActive = FALSE, mktoAddByDefault = TRUE: This should include the module on the canvas BUT NOT in the sidebar

mktoActive = TRUE, mktoAddByDefault = FALSE: This should NOT include the module on the canvas but include it in the sidebar

mktoActive = FALSE, mktoAddByDefault = FALSE: This should NOT include the module on the canvas NOR in the sidebar

 

It sounds like you've got this setup correctly but are still seeing an issue with the modules being displayed as you'd expect them to. Is there a chance you could share your email code using the syntax highlighter here (Click HTML button in the toolbar then the </> button to add code). 

 

Sight unseen, the only thing I could think of that might cause something like this to happen is if the modules were all NOT nested in the same class="mktoContainer" (which I would assume is a table based on your markup). Here's a link to the docs for the containers: https://experienceleague.adobe.com/docs/marketo/using/product-docs/email-marketing/general/email-edi... -- this has a warning that you can only use one main container so maybe if they were in different containers something like this might occur?

 

Alternately, something might have gotten funny while you were working on the email template code -- a lot of times I'll hit the "Preview" button before the code is actually saved and the changes that I made (which are unsaved) don't end up sticking even though they show in the code editor. You might try copying your code from the existing template and spinning up new template and pasting the code in there. Wait for the "Auto-Saving" thing in the top right corner to do it's thing and then approve the template and try making an Email asset and see if you get any different results?

RootreeCory
Level 1

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

Hi @Dave_Roberts , thanks for the thorough response, it took me a while to explore.

 

After doing a lot of testing, your explanation IS how it works.

I have also found why I was having issues, and it had to do with the route I was taking to create templates.

 

I was testing the code for my emails in the Design Studio under Default > Emails > *right click* > New Email. This was so I could see all of my modifications to the tokens and <meta>/Variables, etc. (I only created one of these and updated the code via "Edit Code")

Once I was ready to create a template from that email, I would click Email Actions > Save as Template. (This is where things differ)

Using this "Save as Template" option, when the template was created, any emails created from it would NOT have any modules that were set to mktoaddbydefault="false" in the sidebar under Modules. (I created a few of these, as I wasn't totally sure what it was doing with the markup when the template gets created with this method)

 

What I probably should have been doing from the start, was still create my email in Design Studio so that I could test it, but once I go to "create a template", just overwrite the markup in the existing template with my updated markup, same as my Email.

When pasting the markup into the template... well, it added all of the elements that were set to mktoaddbydefault="false" to the sidebar.

 

I trimmed down my template to only contain a single module (a button) and then tested both flows.
So here is the "correct" markup that should work:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
  xmlns:o="urn:schemas-microsoft-com:office:office">

<head>
  <title>BUTTON ONLY EMAIL TEST</title>
  <!--[if !mso]><!-->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!--<![endif]-->
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style type="text/css">
    #outlook a {
      padding: 0;
    }

    body {
      margin: 0;
      padding: 0;
      -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
    }

    table,
    td {
      border-collapse: collapse;
      mso-table-lspace: 0pt;
      mso-table-rspace: 0pt;
    }

    img {
      border: 0;
      height: auto;
      line-height: 100%;
      outline: none;
      text-decoration: none;
      -ms-interpolation-mode: bicubic;
    }

    p {
      display: block;
      margin: 13px 0;
    }
  </style>
  <!--[if mso]>
    <noscript>
    <xml>
    <o:OfficeDocumentSettings>
      <o:AllowPNG/>
      <o:PixelsPerInch>96</o:PixelsPerInch>
    </o:OfficeDocumentSettings>
    </xml>
    </noscript>
    <![endif]-->
  <!--[if lte mso 11]>
    <style type="text/css">
      .mj-outlook-group-fix { width:100% !important; }
    </style>
    <![endif]-->
  <!--[if !mso]><!-->
  <link href="undefined" rel="stylesheet" type="text/css">
  <style type="text/css">
    @import url(undefined);
  </style>
  <!--<![endif]-->
  <style type="text/css">
    @media only screen and (min-width:500px) {
      .mj-column-per-100 {
        width: 100% !important;
        max-width: 100%;
      }
    }
  </style>
  <style media="screen and (min-width:500px)">
    .moz-text-html .mj-column-per-100 {
      width: 100% !important;
      max-width: 100%;
    }
  </style>
  <style type="text/css">
  </style>
  <style type="text/css">
    html,
    body {
      font-size: 16px;
    }

    h1 {
      padding: 0;
      margin: 0;
      margin-top: 12px;
      margin-bottom: 16px;
      font-family: Helvetica, Arial, sans-serif;
    }

    h2 {
      padding: 0;
      margin: 0;
      font-size: 25px;
      font-weight: bold;
      font-family: Helvetica, Arial, sans-serif;
    }

    p {
      font-size: 16px;
      font-family: Helvetica, Arial, sans-serif;
    }

    img {
      max-width: 600px;
    }

    .navActiveIndicator {
      color: transparent;
      font-weight: bold;
      font-size: 26px;
      color: #009444;
    }

    .mktoText h1,
    .mktoText h2,
    .mktoText h3,
    .mktoText h4,
    .mktoText h5,
    .mktoText h6,
    .mktoText small,
    .mktoText sub,
    .mktoText sup,
    .mktoText i,
    .mktoText em,
    .mktoText b,
    .mktoText strong,
    .mktoText p {
      font-family: Helvetica, Arial, sans-serif;
    }

    .mktoText h1 {
      font-size: 42px;
      font-weight: bold;
    }

    .mktoText h2 {
      font-size: 35px;
      font-weight: bold;
    }

    .mktoText h3 {
      font-size: 28px;
      font-weight: bold;
    }

    .mktoText h4 {
      font-size: 23px;
      font-weight: bold;
    }

    .mktoText h5 {
      font-size: 19px;
      font-weight: bold;
    }

    .mktoText h6 {
      font-size: 16px;
      font-weight: bold;
    }

    .mktoText p {
      font-size: 16px;
    }

    .mktoText small {
      font-size: 12px;
    }

    .mktoText i,
    .mktoText em {
      font-style: italic;
    }

    .mktoText b,
    .mktoText strong {
      font-weight: bold;
    }

    .mktoText sup {
      font-size: 10px;
    }

    .mktoText sub {
      font-size: 10px;
    }
  </style>
  <!-- REAL VARIABLES -->
  <!-- Section and Column Variables -->
  <meta class="mktoNumber" id="paddingOuter_Top" mktoname="Outer Padding - Top:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingOuter_Bottom" mktoname="Outer Padding - Bottom:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingOuter_Left" mktoname="Outer Padding - Left:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingOuter_Right" mktoname="Outer Padding - Right:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingInner_Top" mktoname="Inner Padding - Top:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingInner_Bottom" mktoname="Inner Padding - Bottom:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingInner_Left" mktoname="Inner Padding - Left:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="paddingInner_Right" mktoname="Inner Padding - Right:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="borderRadius_TopLeft" mktoname="Corner Radius - T L:" default="16" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="borderRadius_TopRight" mktoname="Corner Radius - T R:" default="16" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="borderRadius_BottomLeft" mktoname="Corner Radius - B L:" default="16" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="borderRadius_BottomRight" mktoname="Corner Radius - B R:" default="16" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <!-- Text and Content Variables -->
  <meta class="mktoColor" id="contentBackground_Color" mktoname="Background Color:" default="#FFFFFF"
    mktomodulescope="true">
  <meta class="mktoColor" id="contentText_Color" mktoname="Text Color:" default="#2d2d2d" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingOuter_Top" mktoname="Text Out Pad - Top:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingOuter_Bottom" mktoname="Text Out Pad - Bottom:" default="25" min="0"
    max="100" units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingOuter_Left" mktoname="Text Out Pad - Left:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingOuter_Right" mktoname="Text Out Pad - Right:" default="0" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingInner_Top" mktoname="Text In Pad - Top:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingInner_Bottom" mktoname="Text In Pad - Bottom:" default="25" min="0"
    max="100" units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingInner_Left" mktoname="Text In Pad - Left:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">
  <meta class="mktoNumber" id="contentPaddingInner_Right" mktoname="Text In Pad - Right:" default="25" min="0" max="100"
    units="px" step="1" mktomodulescope="true">

  <!-- Button Variables -->
  <meta class="mktoString" id="button_Link" mktoname="Button URL:" default="https://rootree.ca/" allowhtml="false"
    mktomodulescope="true">
  <meta class="mktoString" id="button_Content" mktoname="Button Content:" default="Read More" allowhtml="false"
    mktomodulescope="true">
  <meta class="mktoColor" id="button_Color" mktoname="Button Color:" default="#009444" mktomodulescope="true">
  <meta class="mktoColor" id="button_Text" mktoname="Button Text Color:" default="#FFFFFF" mktomodulescope="true">
</head>

<body style="word-spacing:normal;background-color:#f0f0f0;">
  <div style="background-color:#f0f0f0;">
    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;"
      width="100%">
      <tbody id="base" class="mktoContainer">
        <!-- ###############
		Modules go here
	    ############### -->
        <!-- Button Block -->
        <tr class="mktoModule" id="rt-buttonBlock" mktoname="Button Block" mktoaddbydefault="false">
          <td>
            <!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
            <div style="margin:0px auto;max-width:600px;">
              <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
                <tbody>
                  <tr>
                    <td
                      style="direction:ltr;font-size:0px;padding:${contentPaddingOuter_Top} ${contentPaddingOuter_Top} ${contentPaddingOuter_Bottom} ${contentPaddingOuter_Top};text-align:center;">
                      <!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:-41400px;" ><![endif]-->
                      <div class="mj-column-per-100 mj-outlook-group-fix"
                        style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
                        <table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
                          <tbody>
                            <tr>
                              <td
                                style="background-color:#ffffff;border-radius:${borderRadius_TopLeft} ${borderRadius_TopRight} ${borderRadius_BottomRight} ${borderRadius_BottomLeft};vertical-align:top;padding:${contentPaddingInner_Top} ${contentPaddingInner_Right} ${contentPaddingInner_Bottom} ${contentPaddingInner_Left};">
                                <table border="0" cellpadding="0" cellspacing="0" role="presentation" style=""
                                  width="100%">
                                  <tbody>
                                    <tr>
                                      <td align="center" vertical-align="middle"
                                        style="font-size:0px;padding:10px 25px;word-break:break-word;">
                                        <table border="0" cellpadding="0" cellspacing="0" role="presentation"
                                          style="border-collapse:separate;line-height:100%;">
                                          <tbody>
                                            <tr>
                                              <td align="center" bgcolor="${button_Color}" role="presentation"
                                                style="border:solid 1px ${button_Color};border-radius:1000px;cursor:auto;mso-padding-alt:8px 16px;background:${button_Color};"
                                                valign="middle">
                                                <a href="${button_Link}"
                                                  style="display:inline-block;background:${button_Color};color:${button_Text};font-family:Helvetica, Arial, sans-serif;font-size:16px;font-weight:600;line-height:120%;margin:0;text-decoration:none;text-transform:none;padding:8px 16px;mso-padding-alt:0px;border-radius:1000px;"
                                                  target="_blank"> ${button_Content} </a>
                                              </td>
                                            </tr>
                                          </tbody>
                                        </table>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <!--[if mso | IE]></td></tr></table><![endif]-->
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <!--[if mso | IE]></td></tr></table><![endif]-->
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
</html>

 
And if I used the Email Actions > Save as Template function:

(Note: I am only showing the content in the <body> tags as nothing else about the markup was different)

<body style="word-spacing:normal;background-color:#f0f0f0;">
  <div style="background-color:#f0f0f0;">
    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;"
      width="100%">
      <tbody id="base" class="mktoContainer"></tbody>
    </table>
  </div>
</body>

 

As you can see, the markup for the button module that was in the markup just gets removed.

Not sure why I didn't clue into that sooner.

 

So, don't create a template that way; Paste the markup into the template draft that is being worked on.

Everything is working as expected now!

 

Thanks again!

Dave_Roberts
Level 10

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

Awesome, glad to hear you were able to get that figured out.

 

I normally don't use the "Save as Template" functionality but it's good to see you've got that working. Rather than creating a bunch of different templates, you might consider just creating several different email layouts and saving those in a folder to clone if you wanted to prepopulate the content for different use-cases. 

 

This should save you the headache of needing to go back into a new template and change things around (revise / add the missing code) but still give you a way to create different layouts that you could use to clone for new layout-specific emails moving forward into the future. A subtle benefit of this is that everything hangs on a single template and it'll be easier to manage and update into the future compared to several different templates.

RootreeCory
Level 1

Re: How do "mktoActive" and "mktoAddByDefault" actually work?

Woo! Thank you! This actually validates our approach.

Yeah, I am not going to be touching that button any more!

 

The goal is to only have one template for most of our emails.

We built this out with MJML and built a build process around it, so we are getting to a point where everything is falling into place and things are looking very good.

 

And because of this, as you said, we have been able to update the template, then re-add just the updated modules in the emails we are working on and see the updates.

 

First email on this new template goes out tomorrow. 🎉

Thanks again.