I'm trying to create a custom email template.
I have loaded header and I want to start styling it. For example a simple red background color.
Where do I need to add the style?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
{{var template_styles|raw}}
{{css file="css/email.css"}}
</style>
</head>
<body>
{{inlinecss file="css/email-inline.css"}}
<!-- Begin wrapper table -->
<table class="wrapper" width="100%">
<tr>
<td class="wrapper-inner" align="center">
<table class="main" align="center">
<tr>
<td class="header">
<a class="logo" href="{{store url=""}}">
<img
{{if logo_width}}
width="{{var logo_width}}"
{{else}}
width="180"
{{/if}}
{{if logo_height}}
height="{{var logo_height}}"
{{else}}
height="52"
{{/if}}
src="{{var logo_url}}"
alt="{{var logo_alt}}"
border="0"
/>
</a>
</td>
</tr>
<tr>
<td class="main-content">
<!-- Begin Content -->
Best Answer
The way to create a custom template in magento 2 :
Create a module in code :
Add the
registration.php
,README.mk
andetc/module.xml
files.Create config file
In
app/code/<Vendor>/<Module_Name>/etc
add aconfig.xml
file :Create template declaration
In
app/code/<Vendor>/<Module_Name>/etc
add aemail_template.xml
file :app/code/<Vendor>/<Module_Name>/etc/email_template.xml
:Here, I use
Magento_Email
Create html template (in the module your need it, for example Magento_email)
In
app/design/<Vendor>/<theme>/Magento_email/email/
add asignature.html
file ex in Magento_Email:Put the HTML you what in.
Use it
Now, you can call it in in your email :