I am trying to send emails using Handlebars email templates. The problem is that I am not able to use static assets (css file, images...) in the HB code. I have figured out I can paste in CSS to the HB file, using <style> tag, but I can not do this with images.
File structure (inside src folder):
HTML tag which trying to access an image:
<a href=''>
<img src='./img/cocacola.jpg' width='802' height='250' />
</a>
Settings in main.ts:
//Template settings
app.useStaticAssets(join(__dirname, '..', 'src', 'templates'))
app.setBaseViewsDir(join(__dirname, '..', 'src', 'templates'))
app.setViewEngine('hbs')
In the end the email is successfully sent, but the images are missing.