Search code examples
pythonxmlodooodoo-13

Odoo13-CE: Module-E-mail-Marketing: Is it possible to add a new template (see the screenshot)?


In Odoo13 CE (module-E-mail Marketing) there are only two default templates: 'Plain Text' and Template with different email components. Is it possible to add more templates (my own one - see the screenshot)?

Thanks in advance!


Solution

  • Themes are defined inside mass_mailing.email_designer_snippets template, themes templates are defined inside themes_templates file.

    To add a new theme:

    • Define a theme template
    • Alter the email designer snippets template and add a div inside it like for basic theme
    • Add the images like theme_imgs, ... ( check mass_mailing/static/src/img folder)

    Example:

    <template id="email_designer_snippets_new_theme" inherit_id="mass_mailing.email_designer_snippets">
        <xpath expr="//div[@id='email_designer_themes']">
            <div data-name="extended"
                 data-nowrap="1"
                 data-img="/MODULE_NAME/static/src/img/theme_imgs/extended_thumb"
                 data-images-info='{"logo": {"format": "png"}}'>
                 <t t-call="MODULE_NAME.theme_extended_template"/>
            </div>
        </xpath>
    </template>