{"id":311519,"date":"2021-11-12T13:33:53","date_gmt":"2021-11-12T13:33:53","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=311519"},"modified":"2021-11-12T13:33:56","modified_gmt":"2021-11-12T13:33:56","slug":"add-custom-mail-templates-in-shopware-6","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/","title":{"rendered":"How to add a custom mail template with your plugin in Shopware6."},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>In this post, we discuss on custom mail template with your plugin. Sometimes we need to add a custom mail template for sending mail, we do not need to create our own module for mail template, Shopware has its own default mail template module. So we need to add migration for adding a template and its type with your plugin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>We can achieve custom mail template by using a plugin database migration. In this example first of all will create a template type and its technical name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a custom mail type<\/h2>\n\n\n\n<p>If you want to use your custom mail type not only use an existing mail template type for mail template.<\/p>\n\n\n\n<p>Let&#8217;s have a look at the code<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/how-to-add-a-filter-in-the-administration-at-the-shopware\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to add filter in the administration Shopware 6<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php declare(strict_types=1);\n\nnamespace Swag\\BasicExample\\Migration;\n\nuse Doctrine\\DBAL\\Connection;\nuse Shopware\\Core\\Defaults;\nuse Shopware\\Core\\Framework\\Migration\\MigrationStep;\nuse Shopware\\Core\\Framework\\Uuid\\Uuid;\n\nclass Migration1616418675AddMailTemplate extends MigrationStep\n{\n    public function getCreationTimestamp(): int\n    {\n        return 1616418675;\n    }\n\n    public function update(Connection $connection): void\n    {\n        $mailTemplateTypeId = $this-&gt;createMailTemplateType($connection);\n\n        $this-&gt;createMailTemplate($connection, $mailTemplateTypeId);\n    }\n\n    private function createMailTemplateType(Connection $connection): string\n    {\n        $mailTemplateTypeId = Uuid::randomHex();\n\n        $defaultLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;en-GB&#039;);\n        $deLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;de-DE&#039;);\n\n        $englishName = &#039;Example mail template type name&#039;;\n        $germanName = &#039;Beispiel E-Mail Template Name&#039;;\n\n        $connection-&gt;insert(&#039;mail_template_type&#039;, &#091;\n            &#039;id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n            &#039;technical_name&#039; =&gt; &#039;custom_mail_template_type&#039;,\n            &#039;available_entities&#039; =&gt; json_encode(&#091;&#039;product&#039; =&gt; &#039;product&#039;]),\n            &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n        ]);\n\n        if ($defaultLangId !== $deLangId) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; $defaultLangId,\n                &#039;name&#039; =&gt; $englishName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($defaultLangId !== Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM)) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM),\n                &#039;name&#039; =&gt; $englishName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($deLangId) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; $deLangId,\n                &#039;name&#039; =&gt; $germanName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        return $mailTemplateTypeId;\n    }\n\n    \/\/ ...\n}<\/pre>\n\n\n\n<p>In this above code, we create the createMailTemplateType method which returns a newly created mail template type ID. Let&#8217;s have a look at this method, what we actually do.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First of all we&#8217;re fetching the language IDs for <code>en_GB<\/code> and <code>de_DE<\/code><\/li><li>Then we define the translated names for the mail template type<\/li><li>And then the respective <code>mail_template_type<\/code> entry, as well as the translated <code>mail_template_type_translation<\/code> entries are created<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a mail template<\/h2>\n\n\n\n<p>Now we will create a mail template with newly created mail template type id. Here we add two entries for mail_template and mail_template_translation with a new mail template type. Below given the full code for adding a new mail template.<\/p>\n\n\n\n<p>Let&#8217;s have a look at the code<\/p>\n\n\n\n<p><a href=\"https:\/\/webkul.com\/blog\/shopware-multi-seller-marketplace\/\">Multi Seller Marketplace Plugin<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php declare(strict_types=1);\n\nnamespace Swag\\BasicExample\\Migration;\n\nuse Doctrine\\DBAL\\Connection;\nuse Shopware\\Core\\Defaults;\nuse Shopware\\Core\\Framework\\Migration\\MigrationStep;\nuse Shopware\\Core\\Framework\\Uuid\\Uuid;\n\nclass Migration1616418675AddMailTemplate extends MigrationStep\n{\n    public function getCreationTimestamp(): int\n    {\n        return 1616418675;\n    }\n\n    public function update(Connection $connection): void\n    {\n        $mailTemplateTypeId = $this-&gt;createMailTemplateType($connection);\n\n        $this-&gt;createMailTemplate($connection, $mailTemplateTypeId);\n    }\n\n    public function updateDestructive(Connection $connection): void\n    {\n    }\n\n   private function createMailTemplateType(Connection $connection): string\n    {\n        $mailTemplateTypeId = Uuid::randomHex();\n\n        $defaultLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;en-GB&#039;);\n        $deLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;de-DE&#039;);\n\n        $englishName = &#039;Example mail template type name&#039;;\n        $germanName = &#039;Beispiel E-Mail Template Name&#039;;\n\n        $connection-&gt;insert(&#039;mail_template_type&#039;, &#091;\n            &#039;id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n            &#039;technical_name&#039; =&gt; &#039;custom_mail_template_type&#039;,\n            &#039;available_entities&#039; =&gt; json_encode(&#091;&#039;product&#039; =&gt; &#039;product&#039;]),\n            &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n        ]);\n\n        if ($defaultLangId !== $deLangId) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; $defaultLangId,\n                &#039;name&#039; =&gt; $englishName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($defaultLangId !== Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM)) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM),\n                &#039;name&#039; =&gt; $englishName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($deLangId) {\n            $connection-&gt;insert(&#039;mail_template_type_translation&#039;, &#091;\n                &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n                &#039;language_id&#039; =&gt; $deLangId,\n                &#039;name&#039; =&gt; $germanName,\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        return $mailTemplateTypeId;\n    }\n\n    private function getLanguageIdByLocale(Connection $connection, string $locale): ?string\n    {\n        $sql = &lt;&lt;&lt;SQL\nSELECT `language`.`id`\nFROM `language`\nINNER JOIN `locale` ON `locale`.`id` = `language`.`locale_id`\nWHERE `locale`.`code` = :code\nSQL;\n\n        $languageId = $connection-&gt;executeQuery($sql, &#091;&#039;code&#039; =&gt; $locale])-&gt;fetchColumn();\n        if (!$languageId &amp;&amp; $locale !== &#039;en-GB&#039;) {\n            return null;\n        }\n\n        if (!$languageId) {\n            return Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM);\n        }\n\n        return $languageId;\n    }\n\n    private function createMailTemplate(Connection $connection, string $mailTemplateTypeId): void\n    {\n        $mailTemplateId = Uuid::randomHex();\n\n        $defaultLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;en-GB&#039;);\n        $deLangId = $this-&gt;getLanguageIdByLocale($connection, &#039;de-DE&#039;);\n\n        $connection-&gt;insert(&#039;mail_template&#039;, &#091;\n            &#039;id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateId),\n            &#039;mail_template_type_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateTypeId),\n            &#039;system_default&#039; =&gt; 0,\n            &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n        ]);\n\n        if ($defaultLangId !== $deLangId) {\n            $connection-&gt;insert(&#039;mail_template_translation&#039;, &#091;\n                &#039;mail_template_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateId),\n                &#039;language_id&#039; =&gt; $defaultLangId,\n                &#039;sender_name&#039; =&gt; &#039;{{ salesChannel.name }}&#039;,\n                &#039;subject&#039; =&gt; &#039;Example mail template subject&#039;,\n                &#039;description&#039; =&gt; &#039;Example mail template description&#039;,\n                &#039;content_html&#039; =&gt; $this-&gt;getContentHtmlEn(),\n                &#039;content_plain&#039; =&gt; $this-&gt;getContentPlainEn(),\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($defaultLangId !== Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM)) {\n            $connection-&gt;insert(&#039;mail_template_translation&#039;, &#091;\n                &#039;mail_template_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateId),\n                &#039;language_id&#039; =&gt; Uuid::fromHexToBytes(Defaults::LANGUAGE_SYSTEM),\n                &#039;sender_name&#039; =&gt; &#039;{{ salesChannel.name }}&#039;,\n                &#039;subject&#039; =&gt; &#039;Example mail template subject&#039;,\n                &#039;description&#039; =&gt; &#039;Example mail template description&#039;,\n                &#039;content_html&#039; =&gt; $this-&gt;getContentHtmlEn(),\n                &#039;content_plain&#039; =&gt; $this-&gt;getContentPlainEn(),\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n\n        if ($deLangId) {\n            $connection-&gt;insert(&#039;mail_template_translation&#039;, &#091;\n                &#039;mail_template_id&#039; =&gt; Uuid::fromHexToBytes($mailTemplateId),\n                &#039;language_id&#039; =&gt; $deLangId,\n                &#039;sender_name&#039; =&gt; &#039;{{ salesChannel.name }}&#039;,\n                &#039;subject&#039; =&gt; &#039;Beispiel E-Mail Template Titel&#039;,\n                &#039;description&#039; =&gt; &#039;Beispiel E-Mail Template Beschreibung&#039;,\n                &#039;content_html&#039; =&gt; $this-&gt;getContentHtmlDe(),\n                &#039;content_plain&#039; =&gt; $this-&gt;getContentPlainDe(),\n                &#039;created_at&#039; =&gt; (new \\DateTime())-&gt;format(Defaults::STORAGE_DATE_TIME_FORMAT),\n            ]);\n        }\n    }\n\n    private function getContentHtmlEn(): string\n    {\n        return &lt;&lt;&lt;MAIL\n&lt;div style=&quot;font-family:arial; font-size:12px;&quot;&gt;\n    &lt;p&gt;\n        Example HTML content!\n    &lt;\/p&gt;\n&lt;\/div&gt;\nMAIL;\n    }\n\n    private function getContentPlainEn(): string\n    {\n        return &lt;&lt;&lt;MAIL\nExample plain content!\nMAIL;\n    }\n\n    private function getContentHtmlDe(): string\n    {\n        return &lt;&lt;&lt;MAIL\n&lt;div style=&quot;font-family:arial; font-size:12px;&quot;&gt;\n    &lt;p&gt;\n        Beispiel HTML Inhalt!\n    &lt;\/p&gt;\n&lt;\/div&gt;\nMAIL;\n    }\n\n    private function getContentPlainDe(): string\n    {\n        return &lt;&lt;&lt;MAIL\nBeispiel Plain Inhalt!\nMAIL;\n    }\n}<\/pre>\n\n\n\n<p>First of all, we create an update method. In which we add the previous part of code for getting template type id with help of createMailTemplateType, It returns the mail template type id and then it executes the method createMailTemplate, which will cover all the other steps.<\/p>\n\n\n\n<p>Shopware 6 official <a href=\"https:\/\/developer.shopware.com\/docs\/guides\/plugins\/plugins\/content\/mail\/add-mail-template#creating-a-custom-mail-type\" target=\"_blank\" rel=\"noreferrer noopener\">docs<\/a><\/p>\n\n\n\n<p>Now on the createMailTemplate method, which creates the entry for mail_template and mail_template_translation. we&#8217;re fetching the language IDs for both en_GB and de_DE. <\/p>\n\n\n\n<p>That&#8217;s it,once your plugin is installed, the mail template will be added to Shopware.<\/p>\n\n\n\n<p>Thanks for reading, so i hope it will help you. Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this post, we discuss on custom mail template with your plugin. Sometimes we need to add a custom mail template for sending mail, we do not need to create our own module for mail template, Shopware has its own default mail template module. So we need to add migration for adding a template <a href=\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":325,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-311519","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 a custom mail template with your plugin in Shopware6. -<\/title>\n<meta name=\"description\" content=\"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin\" \/>\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\/add-custom-mail-templates-in-shopware-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add a custom mail template with your plugin in Shopware6. -\" \/>\n<meta property=\"og:description\" content=\"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\" \/>\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=\"2021-11-12T13:33:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-12T13:33:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Gupta\" \/>\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=\"Prince Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\"},\"author\":{\"name\":\"Prince Gupta\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd\"},\"headline\":\"How to add a custom mail template with your plugin in Shopware6.\",\"datePublished\":\"2021-11-12T13:33:53+00:00\",\"dateModified\":\"2021-11-12T13:33:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\"},\"wordCount\":367,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\",\"url\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\",\"name\":\"How to add a custom mail template with your plugin in Shopware6. -\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2021-11-12T13:33:53+00:00\",\"dateModified\":\"2021-11-12T13:33:56+00:00\",\"description\":\"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add a custom mail template with your plugin in Shopware6.\"}]},{\"@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\/669b7c5067f73a7ae2204ff4aca829fd\",\"name\":\"Prince Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?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\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Prince Gupta\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/princegupta-wp031\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add a custom mail template with your plugin in Shopware6. -","description":"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin","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\/add-custom-mail-templates-in-shopware-6\/","og_locale":"en_US","og_type":"article","og_title":"How to add a custom mail template with your plugin in Shopware6. -","og_description":"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin","og_url":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-11-12T13:33:53+00:00","article_modified_time":"2021-11-12T13:33:56+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Prince Gupta","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Prince Gupta","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/"},"author":{"name":"Prince Gupta","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd"},"headline":"How to add a custom mail template with your plugin in Shopware6.","datePublished":"2021-11-12T13:33:53+00:00","dateModified":"2021-11-12T13:33:56+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/"},"wordCount":367,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/","url":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/","name":"How to add a custom mail template with your plugin in Shopware6. -","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2021-11-12T13:33:53+00:00","dateModified":"2021-11-12T13:33:56+00:00","description":"How to add custom mail template via migration with your plugins in Shopware 6 | Custom Mail Template with your plugin","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/add-custom-mail-templates-in-shopware-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add a custom mail template with your plugin in Shopware6."}]},{"@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\/669b7c5067f73a7ae2204ff4aca829fd","name":"Prince Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?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\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Prince Gupta"},"url":"https:\/\/webkul.com\/blog\/author\/princegupta-wp031\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/311519","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\/325"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=311519"}],"version-history":[{"count":2,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/311519\/revisions"}],"predecessor-version":[{"id":311560,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/311519\/revisions\/311560"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=311519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=311519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=311519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}