Skip to content

Commit

Permalink
Merge pull request #36 from Bloceducare/development
Browse files Browse the repository at this point in the history
  • Loading branch information
codeWhizperer authored Aug 29, 2023
2 parents ea85355 + eb7853b commit fed1f85
Show file tree
Hide file tree
Showing 3 changed files with 388 additions and 61 deletions.
50 changes: 50 additions & 0 deletions servers/mailer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const hackatonTemplateSource = fs.readFileSync( `${process.cwd()}/servers/templa
const volunteerTemplateSource=fs.readFileSync( `${process.cwd()}/servers/template/volunteer-email.hbs`,
"utf8")

const ticketTemplateSource=fs.readFileSync( `${process.cwd()}/servers/template/ticket-email.hbs`,
"utf8")


interface ImailgunAuth {
Expand All @@ -42,6 +44,7 @@ const template = handlebars.compile(emailTemplateSource);
const qrtemplate = handlebars.compile(QrEmailTemplateSource);
const hackatonTemplate =handlebars.compile(hackatonTemplateSource)
const volunteerTemplate =handlebars.compile(volunteerTemplateSource)
const ticketTemplate =handlebars.compile(ticketTemplateSource)



Expand Down Expand Up @@ -144,6 +147,53 @@ export const sendQrcodeEmail = async (
}
};

export const sendTicketEmail = async (
to: string,
typeOfUser: string,
name: string
) => {
const { from, emailSubject, replyTo } = mailSenderConfig;


const sendApplicationResp = ticketTemplate({
type: typeOfUser,
name,
application: typeOfUser == "speaker" || typeOfUser == "sponsor" || typeOfUser == "volunteer",
replyTo,
});

const ticketMailOptions = {
from,
to,
subject: emailSubject,
html: sendApplicationResp,
};




try {
// const response = await wrappedSendMail(regMailOptions);
const response = await sendGridMail.send(ticketMailOptions)
console.log('ticket sent successful', response)
return {
status: true,
to,
message: "Successfully sent email",
data: response,
};


} catch (e) {
console.log(e, 'error mailing')
return {
status: false,
error: e,
};
}
};


export const sendHackatonEmail = async(email='',)=>{

const { from, replyTo } = mailSenderConfig;
Expand Down
314 changes: 314 additions & 0 deletions servers/template/ticket-email.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0;">
<meta name="format-detection" content="telephone=no"/>


<style>
/* Reset styles */
body { margin: 0; padding: 0; min-width: 100%; width: 100% !important; height: 100% !important;}
body, table, td, div, p, a { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; border-spacing: 0; }
img { border: 0; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; }
#outlook a { padding: 0; }
.ReadMsgBody { width: 100%; } .ExternalClass { width: 100%; }
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Rounded corners for advanced mail clients only */
@media all and (min-width: 560px) {
.container { border-radius: 8px; -webkit-border-radius: 8px; -moz-border-radius: 8px; -khtml-border-radius: 8px;}
}
/* Set color for auto links (addresses, dates, etc.) */
a, a:hover {
color: #127DB3;
}
.footer a, .footer a:hover {
color: #999999;
}
</style>

<!-- MESSAGE SUBJECT -->
<title>You are Invited Web3 Lagos 2023</title>

</head>

<!-- BODY -->
<!-- Set message background color (twice) and text color (twice) -->
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0" marginwidth="0" marginheight="0" width="100%" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%; height: 100%; -webkit-font-smoothing: antialiased; text-size-adjust: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; line-height: 100%;
background-color: #F0F0F0;
color: #000000;"
bgcolor="#F0F0F0"
text="#000000">

<!-- SECTION / BACKGROUND -->
<!-- Set message background color one again -->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%;" class="background"><tr><td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;"
bgcolor="#F0F0F0">

<!-- WRAPPER -->
<!-- Set wrapper width (twice) -->
<table border="0" cellpadding="0" cellspacing="0" align="center"
width="560" style="border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;
max-width: 560px;" class="wrapper">

<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%;
padding-top: 20px;
padding-bottom: 20px;">

<!-- PREHEADER -->
<!-- Set text color to background color -->
<div style="display: none; visibility: hidden; overflow: hidden; opacity: 0; font-size: 1px; line-height: 1px; height: 0; max-height: 0; max-width: 0;
color: #F0F0F0;" class="preheader">
Here is your invitation to Web3 Lagos 2023
</div>

<!-- LOGO -->
<!-- Image text color should be opposite to background color. Set your url, image src, alt and title. Alt text should fit the image size. Real image size should be x2. URL format: http://domain.com/?utm_source={{Campaign-Source}}&utm_medium=email&utm_content=logo&utm_campaign={{Campaign-Name}} -->

<img border="0" vspace="0" hspace="0"
src="https://i.postimg.cc/cLR6n5Nm/log-web.png"
width="100" height="30"
alt="Logo" title="Logo" style="
color: #000000;
font-size: 10px; margin: 0; padding: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none; display: block;" />

</td>
</tr>

<!-- End of WRAPPER -->
</table>

<!-- WRAPPER / CONTEINER -->
<!-- Set conteiner background color -->
<table border="0" cellpadding="0" cellspacing="0" align="center"
bgcolor="#FFFFFF"
width="560" style="border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;
max-width: 560px;" class="container">

<!-- HEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; margin-bottom:10px; padding:10px; width: 87.5%;
padding-top: 25px;
color: #000000;
font-family: sans-serif;" class="header">
<a href="https://ibb.co/R0fdwLp"><img src="https://i.ibb.co/WyZjJSW/IMG-20230814-WA0002.jpg" alt="IMG-20230814-WA0002" border="0"></a>
</td>
</tr>
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; margin-bottom:10px; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 24px; font-weight: bold; line-height: 130%;
padding-top: 25px;
color: #000000;
font-family: sans-serif;" class="header">
Greetings {{name}}, you've got a ticket!
</td>
</tr>

<!-- SUBHEADER -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif") -->
<tr>
<td valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-bottom: 3px; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 18px; font-weight: 300; line-height: 150%;
padding-top: 5px;
color: #000000;
font-family: sans-serif;" class="subheader">
We're thrilled to inform you that a ticket has been reserved for you! When you arrive at the registration desk, kindly present this email to the officials.
</td>
</tr>

<!-- HERO IMAGE -->
<!-- Image text color should be opposite to background color. Set your url, image src, alt and title. Alt text should fit the image size. Real image size should be x2 (wrapper x2). Do not set height for flexible images (including "auto"). URL format: http://domain.com/?utm_source={{Campaign-Source}}&utm_medium=email&utm_content={{Ìmage-Name}}&utm_campaign={{Campaign-Name}} -->

<tr>
<td valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 160%; padding-top: 20px; color: #000000; font-family: sans-serif;" class="paragraph">
<ul style="list-style: none; padding-left: 0;">
<li style="font-weight: 600; margin-bottom: 10px;">Event Details</li>
<li>Date: August 31st - September 2</li>
<li>Venue: <a href="https://goo.gl/maps/jqscGTa3jJsFMQVo9" target="_blank" >
The Zone, Gbagada, Lagos
</a></li>
<li>Start Time: 9:00 AM</li>
</ul>
</td>
</tr>



<tr>
<td valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 160%;
padding-top: 5px;
color: #000000;
font-family: sans-serif;" class="paragraph">
For an overview of the event schedule, please visit
<a href="https://event.web3bridge.com" target="_blank" style="color: #127DB3; font-family: sans-serif; font-size: 17px; font-weight: 400; line-height: 160%;">event.web3bridge.com</a> for event schedule.
</td>
</tr>


<tr>
<td valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 100%;
padding-top: 20px;
padding-bottom: 0;
color: #000000;
font-family: sans-serif;" class="paragraph">
Best,
</td>
</tr>
<tr>
<td valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 160%;
padding-top: 20px;
padding-bottom: 25px;
color: #000000;
font-family: sans-serif;" class="paragraph">
Event Organising Team
</td>
</tr>
<!-- PARAGRAPH -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif"). Duplicate all text styles in links, including line-height -->


<!-- BUTTON -->
<!-- Set button background color at TD, link/text color at A and TD, font family ("sans-serif" or "Georgia, serif") at TD. For verification codes add "letter-spacing: 5px;". Link format: http://domain.com/?utm_source={{Campaign-Source}}&utm_medium=email&utm_content={{Button-Name}}&utm_campaign={{Campaign-Name}} -->

<!-- LINE -->
<!-- Set line color -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%;
padding-top: 25px;" class="line"><hr
color="#E0E0E0" align="center" width="100%" size="1" noshade style="margin: 0; padding: 0;" />
</td>
</tr>


<!-- PARAGRAPH -->
<!-- Set text color and font family ("sans-serif" or "Georgia, serif"). Duplicate all text styles in links, including line-height -->
<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 17px; font-weight: 400; line-height: 160%;
padding-top: 20px;
padding-bottom: 25px;
color: #000000;
font-family: sans-serif;" class="paragraph">
Have a&nbsp;question? <a href="mailto:registration@web3bridge.com" target="_blank" style="color: #127DB3; font-family: sans-serif; font-size: 17px; font-weight: 400; line-height: 160%;">event@web3bridge.com</a>
</td>
</tr>

<!-- End of WRAPPER -->
</table>


<table style="font-family:'Open Sans',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td class="v-container-padding-padding" style="overflow-wrap:break-word;word-break:break-word;padding:14px;font-family:'Open Sans',sans-serif;" align="left">

<div align="center">
<div style="display: table; max-width:187px;">
<!--[if (mso)|(IE)]><table width="187" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse;" align="center"><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:187px;"><tr><![endif]-->


<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody><tr style="vertical-align: top"><td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="https://www.linkedin.com/company/web3bridge/" title="LinkedIn" target="_blank">
<img src="https://i.postimg.cc/brYgJ7M6/image-4.png" alt="LinkedIn" title="LinkedIn" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td></tr>
</tbody></table>
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody><tr style="vertical-align: top"><td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="https://instagram.com/web3bridge" title="Instagram" target="_blank">
<img src="https://i.postimg.cc/DZpJrR0p/image-2.png" alt="Instagram" title="Instagram" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td></tr>
</tbody></table>
<!--[if (mso)|(IE)]></td><![endif]-->

<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="width: 32px !important;height: 32px !important;display: inline-block;border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;margin-right: 15px">
<tbody><tr style="vertical-align: top"><td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="https://twitter.com/Web3Bridge" title="Twitter" target="_blank">
<img src="https://i.postimg.cc/QChMsLJf/image-1.png" alt="Twitter" title="Twitter" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
</td></tr>
</tbody></table>

</div>
</div>

</td>
</tr>
</tbody>
</table>

<!-- WRAPPER -->
<!-- Set wrapper width (twice) -->


<table style="font-family:'Open Sans',sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td class="v-container-padding-padding" style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:'Open Sans',sans-serif;" align="left">

<div style="color: #828080; line-height: 160%; text-align: center; word-wrap: break-word;">

<p style="font-size: 14px; line-height: 160%;">
<a href="#!">
UnSubscribe
</a>
| <a href="#!">
Privacy Policy
</a>
</p>

<p style="font-size: 14px;">No. 3 Abadek Avenue Ogunlewe Street, Ikorodu Lagos</p>

</div>

</td>
</tr>




<tr>
<td>

<table border="0" cellpadding="0" cellspacing="0" align="center"
width="560" style="border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;
max-width: 560px;" class="wrapper">




<tr>
<td align="center" valign="top" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; padding-left: 6.25%; padding-right: 6.25%; width: 87.5%; font-size: 13px; font-weight: 400; line-height: 150%;
padding-top: 0px;
padding-bottom: 20px;
color: #999999;
font-family: sans-serif;" class="footer">

This email was sent to&nbsp;you because you registered for the web3 Lagos 2023 event.



</td>
</tr>

<!-- End of WRAPPER -->
</table>
</td>
</tr>

</tbody>
</table>


<!-- End of SECTION / BACKGROUND -->
</td></tr></table>

</body>
</html>
Loading

0 comments on commit fed1f85

Please sign in to comment.