Skip to content

Commit

Permalink
chore: enable mailing basic templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Birloi Florian authored and Birloi Florian committed Aug 9, 2023
1 parent a0f223b commit a397540
Show file tree
Hide file tree
Showing 7 changed files with 3,581 additions and 2,783 deletions.
6,252 changes: 3,563 additions & 2,689 deletions backend/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"class-validator": "^0.14.0",
"date-fns": "^2.29.3",
"expo-server-sdk": "^3.7.0",
"handlebars": "^4.7.8",
"helmet": "^6.0.1",
"jwks-rsa": "^3.0.1",
"nestjs-pino": "^3.1.2",
Expand Down
8 changes: 2 additions & 6 deletions backend/src/infrastructure/config/email-config.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MailerOptions } from '@nestjs-modules/mailer';
import { ConfigService } from '@nestjs/config';
import { Injectable } from '@nestjs/common';
// import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';
import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';

@Injectable()
export class EmailConfigService {
Expand All @@ -25,7 +25,7 @@ export class EmailConfigService {
preview: true,
template: {
dir: __dirname + '/../../modules/mail/templates',
// adapter: new HandlebarsAdapter({ asset_url: this.createAssetUrl }),
adapter: new HandlebarsAdapter(),
options: {
strict: true,
},
Expand All @@ -40,8 +40,4 @@ export class EmailConfigService {
},
};
}

// createAssetUrl = (assetName: string): string => {
// return `${this.configService.get('AWS_S3_BUCKET_NAME')}/mail/${assetName}`;
// };
}
5 changes: 0 additions & 5 deletions backend/src/modules/mail/templates/mail-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@
<div id="content">
<h1>{{title}}</h1>
<p class="p1">{{subtitle}}</p>
{{#if cta}}
<a href={{cta.link}} target="_blank">
<button type="button">{{cta.label}}</button>
</a>
{{/if}}
{{> faq-tc}}
</div>
{{> footer}}
Expand Down
11 changes: 3 additions & 8 deletions backend/src/modules/mail/templates/partials/faq-tc.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<style>
.p2 {
font-size: 0.875rem;
}
.mt-3 {
margin-top: 3rem;
}
.p2 { font-size: 0.875rem; } .mt-3 { margin-top: 3rem; }
</style>
<p class='p2 mt-3'>If you have any questions, reach out to us at
<a href="mailto:[email protected]">[email protected]</a>. Need help? Check out our
<a href='mailto:[email protected]'>[email protected]</a>. Need help? Check out
our
<a href='/' target='_blank'>FAQs</a>
and
<a href='/' target='_blank'>Terms and conditions</a>.
Expand Down
84 changes: 11 additions & 73 deletions backend/src/modules/mail/templates/partials/footer.hbs
Original file line number Diff line number Diff line change
@@ -1,77 +1,15 @@
<style>
.footer-container {
background-color: #000000;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
padding: 1.5rem 5rem;
}
.disclaimer {
color: #6B7280;
}
.flex-row {
display: flex;
flex-direction: row;
}
.icon {
margin: 0 1rem;
}
.cg-1 {
column-gap: 1rem;
}
.rg-2 {
row-gap: 1.5rem;
}
.w-full {
width: 100%;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
#divider {
width: 100%;
height: 1px;
background: #FFFFFF;
}
#social {
display: flex;
flex-direction: row;
}
.footer-container { background-color: #000000; color: #ffffff; display: flex;
flex-direction: column; align-items: center; padding: 1.5rem 5rem; }
.disclaimer { color: #6B7280; } .flex-row { display: flex; flex-direction:
row; } .icon { margin: 0 1rem; } .cg-1 { column-gap: 1rem; } .rg-2 { row-gap:
1.5rem; } .w-full { width: 100%; } .items-center { align-items: center; }
.justify-center { justify-content: center; } #divider { width: 100%; height:
1px; background: #FFFFFF; } #social { display: flex; flex-direction: row; }
</style>
<div class="footer-container rg-2">
<div class="flex-row cg-1 w-full items-center justify-center">
<p class="p2">Soluție proiectată, dezvoltată și administrată pro-bono de</p>
<img class="logo" src={{asset_url 'code4romania_logo.png' }}>
</div>

<div id="divider"></div>

<p class="p2 text-center w-full">Dacă vrei să iei legătura cu noi o poți face pe e-mail la adresa: [email protected]
<div class='footer-container rg-2'>
<p class='p2 text-center w-full'>Dacă vrei să iei legătura cu noi o poți face
pe e-mail la adresa: [email protected]
</p>

<div id="social">
<a href="https://www.facebook.com/code4romania/" target="_blank">
<img class="icon" src={{asset_url 'facebook_logo.png' }}></a>
<a href="https://www.instagram.com/code4romania" target="_blank">
<img class="icon" src={{asset_url 'instagram_logo.png' }}></a>
<a href="/" target="_blank">
<img class="icon" src={{asset_url 'youtube_logo.png' }}></a>
<a href="https://github.com/code4romania/" target="_blank">
<img class="icon" src={{asset_url 'github_logo.png' }}></a>
</div>
<p class="p2 disclaimer text-center">© 2020 Code4Romania. All rights reserved.</p>
<p class='p2 disclaimer text-center'>© 2020 Code4Romania. All rights reserved.</p>
</div>
3 changes: 1 addition & 2 deletions backend/src/modules/mail/templates/partials/header.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<div>
<img src={{asset_url 'header.png' }} style="width: 100%;">
<div style='width: 100%; height: 50px; background-color: turquoise'>
</div>

0 comments on commit a397540

Please sign in to comment.