Skip to content

Commit

Permalink
fix: add vic logo, correct footer (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
radulescuandrew authored Dec 20, 2023
1 parent 838c67b commit 9e92e94
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 18 deletions.
8 changes: 7 additions & 1 deletion backend/src/infrastructure/config/email-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class EmailConfigService {
preview: true,
template: {
dir: __dirname + '/../../modules/mail/templates',
adapter: new HandlebarsAdapter(),
adapter: new HandlebarsAdapter({ asset_url: this.createAssetUrl }),
options: {
strict: true,
},
Expand All @@ -40,4 +40,10 @@ export class EmailConfigService {
},
};
}

createAssetUrl = (assetName: string): string => {
return `https://${this.configService.get(
'AWS_S3_BUCKET_NAME_PUBLIC',
)}/${assetName}`;
};
}
4 changes: 4 additions & 0 deletions backend/src/modules/mail/services/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export class MailService {
from,
template: './mail-template',
...email,
context: {
...email.context,
contactEmail: process.env.MAIL_CONTACT, // To make available the variable to all templates, especially the partials (header and footer)
},
});
}
}
9 changes: 7 additions & 2 deletions backend/src/modules/mail/templates/mail-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
#content {
padding: 1rem 5rem;
padding: 1rem 1.5rem;
}
</style>
</head>
Expand All @@ -67,7 +67,12 @@
<div id="content">
<h1>{{title}}</h1>
<p class="p1">{{subtitle}}</p>
{{> faq-tc}}
{{#if cta}}
<a href={{cta.link}} target="_blank">
<button type="button">{{cta.label}}</button>
</a>
{{/if}}
{{!-- {{> faq-tc}} --}}
</div>
{{> footer}}
</div>
Expand Down
97 changes: 83 additions & 14 deletions backend/src/modules/mail/templates/partials/footer.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,84 @@
<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; }
</style>
<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]
<div
style='background-color: #000000; color: #ffffff !important; padding: 1.5rem 1.5rem;'
>
<table
style='width: 80%; border: none; margin-left: auto; margin-right: auto; padding-bottom: 1rem'
>
<tr>
<td>
<p style='color: #ffffff !important; font-size: 0.75rem'>
Soluție proiectată, dezvoltată și administrată pro-bono de
</p>
</td>
<td>
<img
class='logo'
style='width:140px'
src={{asset_url 'email/logo.png'}}
/>
</td>
</tr>
</table>

<div style='width: 100%; height: 1px; background: #ffffff'></div>

<p
style='
text-align: center;
width: 100%;
color: #ffffff !important;
font-size: 0.75rem;
margin-top: 1.5rem
'
>
Dacă vrei să iei legătura cu noi o poți face pe e-mail la adresa:
<a
style='color: #ffffff !important; font-size: 0.75rem;'
href='mailto:{{contactEmail}}'
>{{contactEmail}}</a>
</p>
<p class='p2 disclaimer text-center'>© 2020 Code4Romania. All rights reserved.</p>
</div>

<table
style='width: 50%; border: none; margin-left: auto; margin-right: auto; padding-top: 1rem'
>
<tr>
<td style='width: 30px; height: 30px'>
<a
style='text-decoration: none; color: #1a15ea'
href='https://www.facebook.com/code4romania/'
target='_blank'
>
<img class='icon' src={{asset_url 'email/social/facebook.png'}} />
</a>
</td>
<td style='width: 30px; height: 30px'>
<a
style='text-decoration: none; color: #1a15ea'
href='https://www.instagram.com/code4romania'
target='_blank'
>
<img class='icon' src={{asset_url 'email/social/instagram.png'}} />
</a>
</td>
<td style='width: 30px; height: 30px'>
<a
style='text-decoration: none; color: #1a15ea'
href='https://www.youtube.com/@codeforromania5856'
target='_blank'
>
<img class='icon' src={{asset_url 'email/social/youtube.png'}} />
</a>
</td>
<td style='width: 30px; height: 30px'>
<a
style='text-decoration: none; color: #1a15ea'
href='https://github.com/code4romania/'
target='_blank'
>
<img class='icon' src={{asset_url 'email/social/github.png'}} />
</a>
</td>
</tr>
</table>
</div>
`
3 changes: 2 additions & 1 deletion backend/src/modules/mail/templates/partials/header.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<div style='width: 100%; height: 50px; background-color: turquoise'>
<div style='width: 100%; background-color: black; padding: 1rem 1.5rem;'>
<img src={{asset_url 'email/vic-logo.png'}} />
</div>

0 comments on commit 9e92e94

Please sign in to comment.