Html mailing template
Here is an example of a basic HTML email template:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Template</title>
<style>
/* Add some basic styling to make the email look decent */
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
padding: 0;
margin: 0;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #f9f9f9;
border: 1px solid #ddd;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header {
background-color: #333;
color: #fff;
padding: 10px;
text-align: center;
border-bottom: 1px solid #333;
}
.header h1 {
font-size: 24px;
margin: 0;
}
.content {
padding: 20px;
}
.footer {
background-color: #f9f9f9;
padding: 10px;
text-align: center;
border-top: 1px solid #ddd;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Email Template</h1>
</div>
<div class="content">
<!-- Add your email content here -->
<p>Hello {{ name }},</p>
<p>This is an example email template.</p>
<p>Best regards,</p>
<p>{{ senderName }}</p>
</div>
<div class="footer">
<p>This email was sent by {{ senderEmail }}.</p>
</div>
</div>
</body>
</html>
This template includes the following elements:
- A basic HTML structure with a
<head>
and a<body>
- A CSS stylesheet to add some basic styling to the email
- A
.container
div to wrap the entire email content - A
.header
div to add a header section with a background color and text - A
.content
div to add the main email content - A
.footer
div to add a footer section with a background color and text
You can customize this template by adding your own content, images, and styles. Keep in mind that email clients may render HTML emails differently, so it's a good idea to test your template in different email clients to ensure it looks as intended.
Here are some tips for creating a good HTML email template:
- Use a simple and consistent layout
- Use a clear and readable font
- Use a consistent color scheme
- Avoid using too much JavaScript or complex CSS
- Test your template in different email clients to ensure it looks as intended
- Use a responsive design to ensure the email looks good on different devices and screen sizes