How to use the mjml-core.helpers.startConditionalTag function in mjml-core

To help you get started, we’ve selected a few mjml-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mjmlio / mjml / packages / mjml-hero / src / Hero.js View on Github external
backgroundHeight = $element.data('background-height')

      backgroundCropTop = dataCrop.split(', ')[0].split(':')[1]
      backgroundCropBottom = dataCrop.split(', ')[1].split(':')[1]

      $element
        .removeAttr('class')
        .removeAttr('data-background-height')
        .removeAttr('data-crop')
    }

    backgroundWidth = parseInt(backgroundWidth.replace('px', '')) * 0.75
    backgroundHeight = parseInt(backgroundHeight.replace('px', '')) * 0.75

    $(this)
      .before(`${helpers.startConditionalTag}
          
        ${helpers.endConditionalTag}`)
      .removeAttr('class')
      .removeAttr('data-background-width')
      .removeAttr('data-background-height')
      .removeAttr('data-background-url')
  })
github mjmlio / mjml / packages / mjml-hero / src / HeroContent.js View on Github external
$mjHeroContent.each(function () {
    const width = $(this).css('width')
    const align = $(this).data('align')
    const backgroundColor = $(this).data('background-color')

    $(this).before(`${helpers.startConditionalTag}
      <table style="width:${width};" width="${width.replace('px', '')}" align="${align}" cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="padding:0;background-color:${backgroundColor};">
      ${helpers.endConditionalTag}`)
    .after(`${helpers.startConditionalTag}
      </td></tr></tbody></table>
      ${helpers.endConditionalTag}`)
    .removeAttr('data-background-color')
    .removeAttr('data-align')
  })
github mjmlio / mjml / packages / mjml-section / src / index.js View on Github external
$('.mj-section-outlook-background').each(function () {
    const url = $(this).data('url')
    const width = parseInt($(this).data('width'))

    $(this)
      .removeAttr('class')
      .removeAttr('data-url')
      .removeAttr('data-width')

    if (!url) {
      return
    }

    $(this).before(`${helpers.startConditionalTag}
      
        
        
      ${helpers.endConditionalTag}`)

    $(this).after(`${helpers.startConditionalTag}
        <p style="margin:0;mso-hide:all">&nbsp;</p>
        
      
      ${helpers.endConditionalTag}`)
  })
github mjmlio / mjml / packages / mjml-social / src / index.js View on Github external
$('.mj-social-outlook-open').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      <table align="${$(this).data('align')}" cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td>
      ${helpers.endConditionalTag}`)
  })
</td></tr></tbody></table>
github mjmlio / mjml / packages / mjml-wrapper / src / index.js View on Github external
$('.mj-wrapper-outlook-open').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      <table cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="width:${parseInt($(this).data('width'))}px;">
      ${helpers.endConditionalTag}`)
  })
</td></tr></tbody></table>
github mjmlio / mjml / packages / mjml-container / src / index.js View on Github external
$('.mj-container-outlook-line').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      
      ${helpers.endConditionalTag}
      ${helpers.startConditionalTag}
      <table style="width:${containerWidth}px;" align="center" width="${containerWidth}" cellspacing="0" cellpadding="0" border="0" role="presentation">
        <tbody><tr>
          <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
      ${helpers.endConditionalTag}`)
  })
</td></tr></tbody></table>