dustin/shopware-utils
  • dustin/shopware-utils
  • Installation
    • Installation
  • Bundles
    • Plugins and AdditionalBundles
      • Create plugin
      • Add additional bundles
    • Themes
  • Migrations
  • Features
    • Configuration
  • Adding resources
    • Custom fields
    • Document types
    • Payment methods
    • Mail template types
    • Mail templates
Powered by GitBook
On this page
  1. Adding resources

Mail templates

Mail templates can be brought with your plugin or AdditionalBundle. For each mail template you need to create 5 files:

  • <name>.json - the definition file

  • <name>.de-DE.twig - plain template twig file in german

  • <name>.de-DE.html.twig - html template twig file in german

  • <name>.en-GB.twig - plain template twig file in english

  • <name>.en-GB.html.twig - html template twig file in english

Each file must be found in the Resources/mail_templates/ directory of your plugin or bundle. Each mail template must have a predefined id.

Mail templates will only be installed but not updated. This allows users to edit templates in the Shopware administration.

Mail templates will not be uninstalled on plugin uninstallation.

{
    "id": "befd8c25231344929c2648d90e986904",
    "name": "my_mail_template",
    "type": "customer_register",
    "systemDefault": false,                            // optional
    "translations": {
        "de-DE": {
            "subject": "Ein Betreff",
            "description": "Ein Beschreibungstext",    // optional  
            "senderName": "Ein Absender"               // optional
        },
        "en-GB": {
            "subject": "A subject",
            "description": "A description text",       // optional
            "senderName": "A sender"                   // optional
        }
    }
}

Run bin/console plugin:update <PluginName> to install new mail templates.

PreviousMail template types

Last updated 1 month ago