{"id":338195,"date":"2022-06-03T13:21:30","date_gmt":"2022-06-03T13:21:30","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=338195"},"modified":"2022-06-03T13:22:57","modified_gmt":"2022-06-03T13:22:57","slug":"how-to-add-an-email-layout-and-variables-in-a-theme-from-module","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/","title":{"rendered":"How to add an email layout and variables in a theme from a module"},"content":{"rendered":"\n<p>You can add your own email layout and variables from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.<\/p>\n\n\n\n<p>So let&#8217;s start by creating a mail layout in modern theme.<\/p>\n\n\n\n<p>You will first have to prepare your layouts, let\u2019s say you store them in the&nbsp;<code>mail\/layouts<\/code>&nbsp;folder of your module.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{# modules\/demoemail\/mails\/layout\/custom_modern_layout.html.twig #}\n{% extends &#039;@MailThemes\/modern\/components\/layout.html.twig&#039; %}\n\n{% block content %}\n  &lt;table width=&quot;100%&quot;&gt;\n    &lt;tr&gt;\n      &lt;td align=&quot;center&quot; class=&quot;titleblock&quot;&gt;\n        &lt;font size=&quot;2&quot; face=&quot;{{ languageDefaultFont }}Open-sans, sans-serif&quot; color=&quot;#555454&quot;&gt;\n          &lt;span class=&quot;title&quot;&gt;{{ &#039;This is an example mail template from my module for modern theme&#039;|trans({}, &#039;EmailsBody&#039;, locale)|raw }}&lt;\/span&gt;\n          &lt;br&gt;\n          &lt;span class=&quot;subtitle&quot;&gt;{{ customMessage }}&lt;\/span&gt;\n        &lt;\/font&gt;\n      &lt;\/td&gt;\n      \n    &lt;\/tr&gt;\n    &lt;tr&gt;\n      &lt;td class=&quot;space_footer&quot;&gt;&amp;nbsp;&lt;\/td&gt;\n    &lt;\/tr&gt;\n  &lt;\/table&gt;\n{% endblock %}<\/pre>\n\n\n\n<p>Now you need to add your layout to the theme\u2019s layout collection &amp; your variables for this specific layout, in order to do so you will use the&nbsp;<code>actionListMailThemes<\/code>&nbsp;&amp; actionBuildMailLayoutVariables hook.<\/p>\n\n\n\n<p>So add the below code to your module class file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\Layout\\Layout;\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\ThemeCatalogInterface;\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\ThemeCollectionInterface;\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\ThemeInterface;\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\Layout\\LayoutVariablesBuilderInterface;\nuse PrestaShop\\PrestaShop\\Core\\MailTemplate\\Layout\\LayoutInterface;\n\nclass Demoemail extends Module {\n    public function __construct()\n    {\n        $this-&gt;name = &#039;demoemail&#039;;\n        $this-&gt;tab = &#039;others&#039;;\n        $this-&gt;version = &#039;4.0.0&#039;;\n        $this-&gt;author = &#039;webkul&#039;;\n        $this-&gt;need_instance = 1;\n        $this-&gt;bootstrap = true;\n\n        parent::__construct();\n\n        $this-&gt;displayName = $this-&gt;l(&#039;Demo Email&#039;);\n        $this-&gt;description = $this-&gt;l(&#039;Demo Email&#039;);\n\n        $this-&gt;confirmUninstall = $this-&gt;l(&#039;Are you sure?&#039;);\n\n        $this-&gt;ps_versions_compliancy = array(&#039;min&#039; =&gt; &#039;1.7&#039;, &#039;max&#039; =&gt; _PS_VERSION_);\n    }\n    public function install() {\n        return parent::install()\n            \/\/ This class constant contains &#039;actionListMailThemes&#039;\n            &amp;&amp; $this-&gt;registerHook(ThemeCatalogInterface::LIST_MAIL_THEMES_HOOK)\n            \/\/ This class constant contains &#039;actionBuildMailLayoutVariables&#039;\n            &amp;&amp; $this-&gt;registerHook(LayoutVariablesBuilderInterface::BUILD_MAIL_LAYOUT_VARIABLES_HOOK)\n        ;\n    }\n\n    public function uninstall() {\n        return parent::uninstall()\n            &amp;&amp; $this-&gt;unregisterHook(ThemeCatalogInterface::LIST_MAIL_THEMES_HOOK)\n            &amp;&amp; $this-&gt;unregisterHook(LayoutVariablesBuilderInterface::BUILD_MAIL_LAYOUT_VARIABLES_HOOK)\n        ;\n    }\n\n    public function enable($force_all = false) {\n        return parent::enable($force_all = false)\n            &amp;&amp; $this-&gt;registerHook(ThemeCatalogInterface::LIST_MAIL_THEMES_HOOK)\n            &amp;&amp; $this-&gt;registerHook(LayoutVariablesBuilderInterface::BUILD_MAIL_LAYOUT_VARIABLES_HOOK)\n        ;\n    }\n\n    public function disable($force_all = false) {\n        return parent::disable($force_all = false)\n            &amp;&amp; $this-&gt;unregisterHook(ThemeCatalogInterface::LIST_MAIL_THEMES_HOOK)\n            &amp;&amp; $this-&gt;unregisterHook(LayoutVariablesBuilderInterface::BUILD_MAIL_LAYOUT_VARIABLES_HOOK)\n        ;\n    }\n\n    \/**\n     * @param array $hookParams\n     *\/\n    public function hookActionListMailThemes(array $hookParams)\n    {\n        if (!isset($hookParams&#091;&#039;mailThemes&#039;])) {\n            return;\n        }\n\n        \/** @var ThemeCollectionInterface $themes *\/\n        $themes = $hookParams&#091;&#039;mailThemes&#039;];\n\n        \/** @var ThemeInterface $theme *\/\n        foreach ($themes as $theme) {\n            if (!in_array($theme-&gt;getName(), &#091;&#039;classic&#039;, &#039;modern&#039;])) {\n                continue;\n            }\n\n            \/\/ Add a layout to each theme (don&#039;t forget to specify the module name)\n            $theme-&gt;getLayouts()-&gt;add(new Layout(\n                &#039;custom_template&#039;,\n                __DIR__ . &#039;\/mails\/layouts\/custom_&#039; . $theme-&gt;getName() . &#039;_layout.html.twig&#039;,\n                &#039;&#039;,\n                $this-&gt;name\n            ));\n        }\n    }\n\n    \/**\n     * @param array $hookParams\n     *\/\n    public function hookActionBuildMailLayoutVariables(array $hookParams)\n    {\n        if (!isset($hookParams&#091;&#039;mailLayout&#039;])) {\n            return;\n        }\n\n        \/** @var LayoutInterface $mailLayout *\/\n        $mailLayout = $hookParams&#091;&#039;mailLayout&#039;];\n        if ($mailLayout-&gt;getModuleName() != $this-&gt;name || $mailLayout-&gt;getName() != &#039;custom_template&#039;) {\n            return;\n        }\n\n        $hookParams&#091;&#039;mailLayoutVariables&#039;]&#091;&#039;customMessage&#039;] = &#039;My custom message&#039;;\n    }\n}<\/pre>\n\n\n\n<p>You can then go to the \u201cDesign &gt; Email Theme\u201d page and preview the&nbsp;&nbsp;<code>modern<\/code>&nbsp;layouts list.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"607\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png\" alt=\"1-1\" class=\"wp-image-338205\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-300x152.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-250x127.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-768x389.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1.png 1249w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/devdocs.prestashop.com\/1.7\/modules\/concepts\/mail-templates\/img\/custom_template_list.png\"><\/a><\/p>\n\n\n\n<p>You can then go to the \u201cDesign &gt; Email Theme\u201d page and preview your layout you will see that your message has been inserted in your template.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1137\" height=\"490\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/2-1.png\" alt=\"email layout and variables\" class=\"wp-image-338206\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/2-1.png 1137w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/2-1-300x129.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/2-1-250x108.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/2-1-768x331.png 768w\" sizes=\"(max-width: 1137px) 100vw, 1137px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Now, you have learned how to add an email layout and variables in a theme from a module. That\u2019s all about this blog.<\/p>\n\n\n\n<p>If any issue or doubt in the above step, please feel free to let us know in the comment section.<\/p>\n\n\n\n<p>We would be happy to help.<\/p>\n\n\n\n<p>You can also explore our&nbsp;<a href=\"https:\/\/webkul.com\/prestashop-development\/\">PrestaShop Development Services<\/a>&nbsp;and a large range of quality&nbsp;<a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\">PrestaShop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt contact us at&nbsp;<a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can add your own email layout and variables from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders. So let&#8217;s start by creating a mail layout <a href=\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":431,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-338195","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to add an email layout and variables in a theme from a module<\/title>\n<meta name=\"description\" content=\"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add an email layout and variables in a theme from a module\" \/>\n<meta property=\"og:description\" content=\"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-03T13:21:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T13:22:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png\" \/>\n<meta name=\"author\" content=\"Raghvendra Pratap\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Raghvendra Pratap\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\"},\"author\":{\"name\":\"Raghvendra Pratap\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d819867cc25c4d70d2d114e78196e7d5\"},\"headline\":\"How to add an email layout and variables in a theme from a module\",\"datePublished\":\"2022-06-03T13:21:30+00:00\",\"dateModified\":\"2022-06-03T13:22:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\"},\"wordCount\":263,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\",\"name\":\"How to add an email layout and variables in a theme from a module\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png\",\"datePublished\":\"2022-06-03T13:21:30+00:00\",\"dateModified\":\"2022-06-03T13:22:57+00:00\",\"description\":\"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1.png\",\"width\":1249,\"height\":632,\"caption\":\"1-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add an email layout and variables in a theme from a module\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/d819867cc25c4d70d2d114e78196e7d5\",\"name\":\"Raghvendra Pratap\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2aa578a93576e581ac028fb555d206ee963ff164044b165aaff0d6c3e5cfd49a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2aa578a93576e581ac028fb555d206ee963ff164044b165aaff0d6c3e5cfd49a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Raghvendra Pratap\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/raghvendrapratap-singh822\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add an email layout and variables in a theme from a module","description":"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/","og_locale":"en_US","og_type":"article","og_title":"How to add an email layout and variables in a theme from a module","og_description":"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.","og_url":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-06-03T13:21:30+00:00","article_modified_time":"2022-06-03T13:22:57+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png","type":"","width":"","height":""}],"author":"Raghvendra Pratap","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Raghvendra Pratap","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/"},"author":{"name":"Raghvendra Pratap","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d819867cc25c4d70d2d114e78196e7d5"},"headline":"How to add an email layout and variables in a theme from a module","datePublished":"2022-06-03T13:21:30+00:00","dateModified":"2022-06-03T13:22:57+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/"},"wordCount":263,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/","url":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/","name":"How to add an email layout and variables in a theme from a module","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1-1200x607.png","datePublished":"2022-06-03T13:21:30+00:00","dateModified":"2022-06-03T13:22:57+00:00","description":"You can add your own mail layouts from your module, they will then be included during email generation. Each time you install a language or if you generate them via the back office your layout will be rendered, translated, and exported in the appropriate folders.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/06\/1-1.png","width":1249,"height":632,"caption":"1-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-add-an-email-layout-and-variables-in-a-theme-from-module\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add an email layout and variables in a theme from a module"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/d819867cc25c4d70d2d114e78196e7d5","name":"Raghvendra Pratap","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2aa578a93576e581ac028fb555d206ee963ff164044b165aaff0d6c3e5cfd49a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2aa578a93576e581ac028fb555d206ee963ff164044b165aaff0d6c3e5cfd49a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Raghvendra Pratap"},"url":"https:\/\/webkul.com\/blog\/author\/raghvendrapratap-singh822\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/338195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/431"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=338195"}],"version-history":[{"count":3,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/338195\/revisions"}],"predecessor-version":[{"id":338215,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/338195\/revisions\/338215"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=338195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=338195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=338195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}