Logicify / mautic-advanced-templates-bundle

Plugin extends default email template capabilities with TWIG block so you can use advanced scripting techniques like conditions, loops etc
https://logicify.com/?utm_source=github&utm_campaign=mautic-templates&utm_medium=opensource
MIT License
86 stars 57 forks source link

RSS support #3

Closed kuzmany closed 5 years ago

kuzmany commented 5 years ago

This PR added support for rss and rss related based on categories and contact segments.

This PR we're using on production

RSS support

     {% TWIG_BLOCK %} 
          {% set items = 'http://domain.tld/feed/' | rss %}     
          <ul> 
          {% for item in items %}
              <li>
               <a href=''{{ item.link }}'>{{ item.title }}</a> ({{ item.pubDate|date('m/d/Y') }})
               <br />{{ item.description|raw }}
               </li>
          {% endfor %}
          </ul>             
      {% END_TWIG_BLOCK %}

RSS related items to contact's segments

        {% TWIG_BLOCK %} 
            {% set items = 'http://domain.tld/feed/' | rss('segments') %}     
            <ul> 
            {% for item in items %}
                <li>
                 <a href=''{{ item.link }}'>{{ item.title }}</a> ({{ item.pubDate|date('m/d/Y') }})
                 <br />{{ item.description|raw }}
                 </li>
            {% endfor %}
            </ul>             
        {% END_TWIG_BLOCK %}
albanleandri commented 5 years ago

It's awesome