Skip to content

Commit

Permalink
add order confirm email
Browse files Browse the repository at this point in the history
  • Loading branch information
iqbal125 committed Jan 12, 2021
1 parent 2f10083 commit 1088154
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 3 deletions.
163 changes: 163 additions & 0 deletions server/emails/order confirm/html.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Receipt for [Product Name]</title>
</head>
<body style="-webkit-text-size-adjust: none; box-sizing: border-box; color: #74787e; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; height: 100%; line-height: 1.4; margin: 0; width: 100% !important;" bgcolor="#f2f4f6">
<style type="text/css">
body {
width: 100% !important;
height: 100%;
margin: 0;
line-height: 1.4;
background-color: #f2f4f6;
color: #74787e;
-webkit-text-size-adjust: none;
}
@media only screen and (max-width: 600px) {
.email-body_inner {
width: 100% !important;
}
.email-footer {
width: 100% !important;
}
}
@media only screen and (max-width: 500px) {
.button {
width: 100% !important;
}
}
</style>
<table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0; padding: 0; width: 100%;" bgcolor="#f2f4f6">
<tr>
<td align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table class="email-content" width="100%" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0; padding: 0; width: 100%;">
<tr>
<td class="email-masthead" style="box-sizing: border-box; font-family: Arial, sans-serif; padding: 25px 0; word-break: break-word;" align="center">
<a href="https://example.com" class="email-masthead_name" style="box-sizing: border-box; color: #bbbfc3; font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; text-decoration: none;">[Product Name]</a>
</td>
</tr>
<tr>
<td class="email-body" width="100%" cellpadding="0" cellspacing="0" style="-premailer-cellpadding: 0; -premailer-cellspacing: 0; border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; margin: 0; padding: 0; width: 100%; word-break: break-word;" bgcolor="#ffffff">
<table class="email-body_inner" align="center" width="570" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0 auto; padding: 0; width: 570px;" bgcolor="#ffffff">
<tr>
<td class="content-cell" style="box-sizing: border-box; font-family: Arial, sans-serif; padding: 35px; word-break: break-word;">
<h1 style="box-sizing: border-box; color: #2f3133; font-family: Arial, sans-serif; font-size: 19px; font-weight: bold; margin-top: 0;" align="left">Hi {{name}},</h1>
<p style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;" align="left">Thanks for using [Product Name]. This email is the receipt for your purchase. No payment is due.</p>
<p style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;" align="left">This purchase will appear as “[Credit Card Statement Name]” on your credit card statement for your {{credit_card_brand}} ending in {{credit_card_last_four}}. Need to <a href="{{billing_url}}" style="box-sizing: border-box; color: #007dcc; font-family: Arial, sans-serif;">update your payment information</a>?</p>
<table class="discount" align="center" width="100%" cellpadding="0" cellspacing="0" style="border: 2px dashed #9ba2ab; box-sizing: border-box; font-family: Arial, sans-serif; margin: 0 0 20px; padding: 24px; width: 100%;" bgcolor="#EDEFF2">
<tr>
<td align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; padding: 20px; word-break: break-word;">
<h1 class="discount_heading" style="box-sizing: border-box; color: #2f3133; font-family: Arial, sans-serif; font-size: 19px; font-weight: bold; margin-top: 0;" align="center">10% off your next purchase!</h1>
<p class="discount_body" style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 15px; line-height: 1.5em; margin-top: 0;" align="center">Thanks for your support! Here‘s a coupon for 10% off your next purchase if used by {{expiration_date}}.</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="box-sizing: border-box; font-family: Arial, sans-serif;">
<tr>
<td align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table border="0" cellspacing="0" cellpadding="0" style="box-sizing: border-box; font-family: Arial, sans-serif;">
<tr>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<a href="http://example.com" class="button button--blue" target="_blank" style="-webkit-text-size-adjust: none; background: #007dcc; border-color: #007dcc; border-radius: 3px; border-style: solid; border-width: 10px 18px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); box-sizing: border-box; color: #ffffff; display: inline-block; font-family: Arial, sans-serif; text-decoration: none;">Use this discount now...</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="purchase" width="100%" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0 0 20px; padding: 35px 0; width: 100%;">
<tr>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<h3 style="box-sizing: border-box; color: #2F3133; font-family: Arial, sans-serif; font-size: 14px; font-weight: bold; margin-top: 0;" align="left">{{receipt_id}}</h3></td>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<h3 class="align-right" style="box-sizing: border-box; color: #2F3133; font-family: Arial, sans-serif; font-size: 14px; font-weight: bold; margin-top: 0;" align="right">{{date}}</h3></td>
</tr>
<tr>
<td colspan="2" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table class="purchase_content" width="100%" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0; padding: 25px 0 0; width: 100%;">
<tr>
<th class="purchase_heading" style="border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; padding-bottom: 8px;">
<p style="box-sizing: border-box; color: #9BA2AB; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.5em; margin: 0;" align="left">Description</p>
</th>
<th class="purchase_heading" style="border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; padding-bottom: 8px;">
<p class="align-right" style="box-sizing: border-box; color: #9BA2AB; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.5em; margin: 0;" align="right">Amount</p>
</th>
</tr>
{{#each receipt_details}}
<tr>
<td width="80%" class="purchase_item" style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 15px; line-height: 18px; padding: 10px 0; word-break: break-word;">{{description}}</td>
<td class="align-right" width="20%" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;" align="right">{{amount}}</td>
</tr>
{{/each}}
<tr>
<td width="80%" class="purchase_footer" valign="middle" style="border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; padding-top: 15px; word-break: break-word;">
<p class="purchase_total purchase_total--label" style="box-sizing: border-box; color: #2F3133; font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 1.5em; margin: 0; padding: 0 15px 0 0;" align="right">Total</p>
</td>
<td width="20%" class="purchase_footer" valign="middle" style="border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; padding-top: 15px; word-break: break-word;">
<p class="purchase_total" style="box-sizing: border-box; color: #2F3133; font-family: Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 1.5em; margin: 0;" align="right">{{total}}</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;" align="left">If you have any questions about this receipt, simply reply to this email or reach out to our <a href="{{support_url}}" style="box-sizing: border-box; color: #007dcc; font-family: Arial, sans-serif;">support team</a> for help.</p>
<p style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;" align="left">Cheers,
<br />The [Product Name] Team</p>
<table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 30px auto; padding: 0; text-align: center; width: 100%;">
<tr>
<td align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="box-sizing: border-box; font-family: Arial, sans-serif;">
<tr>
<td align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table border="0" cellspacing="0" cellpadding="0" style="box-sizing: border-box; font-family: Arial, sans-serif;">
<tr>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<a href="{{action_url}}" class="button button--blue" target="_blank" style="-webkit-text-size-adjust: none; background: #007dcc; border-color: #007dcc; border-radius: 3px; border-style: solid; border-width: 10px 18px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); box-sizing: border-box; color: #ffffff; display: inline-block; font-family: Arial, sans-serif; font-size: 16px; text-decoration: none;">Download as PDF</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="body-sub" style="border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, sans-serif; margin-top: 25px; padding-top: 25px;">
<tr>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<p class="sub" style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;" align="left">Need a printable copy for your records? You can <a href="{{action_url}}" style="box-sizing: border-box; color: #007dcc; font-family: Arial, sans-serif;">download a PDF version</a>.</p>
<p class="sub" style="box-sizing: border-box; color: #74787e; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;" align="left">Moved recently? Have a new credit card? You can easily <a href="{{billing_url}}" style="box-sizing: border-box; color: #007dcc; font-family: Arial, sans-serif;">update your billing information</a>.</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="box-sizing: border-box; font-family: Arial, sans-serif; word-break: break-word;">
<table class="email-footer" align="center" width="570" cellpadding="0" cellspacing="0" style="box-sizing: border-box; font-family: Arial, sans-serif; margin: 0 auto; padding: 0; text-align: center; width: 570px;">
<tr>
<td class="content-cell" align="center" style="box-sizing: border-box; font-family: Arial, sans-serif; padding: 35px; word-break: break-word;">
<p class="sub align-center" style="box-sizing: border-box; color: #bbbfc3; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;" align="center">© 2021 [Product Name]. All rights reserved.</p>
<p class="sub align-center" style="box-sizing: border-box; color: #bbbfc3; font-family: Arial, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;" align="center">
[Company Name, LLC]
<br />1234 Street Rd.
<br />Suite 1234
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
1 change: 1 addition & 0 deletions server/emails/order confirm/subject.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{name}} welcome
5 changes: 2 additions & 3 deletions server/src/Services/utils/emailTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ export const email = new Email({
export const sendEmail = () => {
email
.send({
template: 'trial expired',
template: 'order confirm',
message: {
to: '[email protected]'
},
locals: {
fname: 'John',
lname: 'Snow'
name: 'John Snow'
}
})
.then(() => console.log('email has been sent!'));
Expand Down

0 comments on commit 1088154

Please sign in to comment.