[GH-ISSUE #544] custom email templates won't work #350

Closed
opened 2026-03-03 01:28:14 +03:00 by kerem · 3 comments
Owner

Originally created by @soyezcloud on GitHub (Jul 24, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/544

hello,

trying to figure out why bitwarden_rs docker won't load the email templates from the TEMPLATES_FOLDER variable. tried a lof of things, read all stuff, but something I don't get it.

here's my commnd line :
sudo docker run -d --name abc \ --rm \ -e ROCKET_TLS={certs='"/ssl/fullchain.pem",key="/ssl/privkey.pem"'} \ -v /ssl/keys/:/ssl/ \ -v /icon_cache/ \ -e SMTP_HOST=smtp.smtpserver.com \ -e SMTP_FROM=yo@mydomain \ -e SMTP_FROM_NAME=mydomain \ -e SMTP_PORT=587 \ -e SMTP_SSL=true \ -e SMTP_USERNAME=498eeb4 \ -e SMTP_PASSWORD=498eeb4 \ -e INVITATIONS_ALLOWED=true \ -e DISABLE_2FA_REMEMBER=false \ -e SIGNUPS_ALLOWED=false \ -e ROCKET_PORT='8000' \ -e DOMAIN=https://mydomain:8000 \ -v /bw-data-sv/:/data/ \ -p 0.0.0.0:8000:8000 \ -e RELOAD_TEMPLATES=true \ -e TEMPLATES_FOLDER=data/templates \ -e LOG_LEVEL=debug \ -e LOG_FILE=/log.txt \ bitwardenrs/server:latest

from the debug file, the output of the email is the original one. it seems to not loading the path correctly as the folder have the custom email templates .hbs files.

host folder /bw-data-sv/templates

@instance-2:/bw-data-sv/templates$ ls -la
total 96
4096 Jul 24 18:39 .
4096 Jul 24 19:26 ..
278 Jul 24 16:07 invite_accepted.hbs
12443 Jul 24 16:07 invite_accepted.html.hbs
264 Jul 24 16:07 invite_confirmed.hbs
11696 Jul 24 16:07 invite_confirmed.html.hbs
110 Jul 24 16:07 pw_hint_none.hbs
11635 Jul 24 16:07 pw_hint_none.html.hbs
12383 Jul 24 16:07 pw_hint_some.html.hbs
553 Jul 24 16:07 send_org_invite.hbs
13190 Jul 24 17:07 send_org_invite.html.hbs

do you see something wrong ? should I need to create my own docker image ?

thank you for any tips,

Originally created by @soyezcloud on GitHub (Jul 24, 2019). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/544 hello, trying to figure out why bitwarden_rs docker won't load the email templates from the `TEMPLATES_FOLDER` variable. tried a lof of things, read all stuff, but something I don't get it. here's my commnd line : `sudo docker run -d --name abc \ --rm \ -e ROCKET_TLS={certs='"/ssl/fullchain.pem",key="/ssl/privkey.pem"'} \ -v /ssl/keys/:/ssl/ \ -v /icon_cache/ \ -e SMTP_HOST=smtp.smtpserver.com \ -e SMTP_FROM=yo@mydomain \ -e SMTP_FROM_NAME=mydomain \ -e SMTP_PORT=587 \ -e SMTP_SSL=true \ -e SMTP_USERNAME=498eeb4 \ -e SMTP_PASSWORD=498eeb4 \ -e INVITATIONS_ALLOWED=true \ -e DISABLE_2FA_REMEMBER=false \ -e SIGNUPS_ALLOWED=false \ -e ROCKET_PORT='8000' \ -e DOMAIN=https://mydomain:8000 \ -v /bw-data-sv/:/data/ \ -p 0.0.0.0:8000:8000 \ -e RELOAD_TEMPLATES=true \ -e TEMPLATES_FOLDER=data/templates \ -e LOG_LEVEL=debug \ -e LOG_FILE=/log.txt \ bitwardenrs/server:latest ` from the debug file, the output of the email is the original one. it seems to not loading the path correctly as the folder have the custom email templates .hbs files. host folder /bw-data-sv/templates > @instance-2:/bw-data-sv/templates$ ls -la > total 96 > 4096 Jul 24 18:39 . > 4096 Jul 24 19:26 .. > 278 Jul 24 16:07 invite_accepted.hbs > 12443 Jul 24 16:07 invite_accepted.html.hbs > 264 Jul 24 16:07 invite_confirmed.hbs > 11696 Jul 24 16:07 invite_confirmed.html.hbs > 110 Jul 24 16:07 pw_hint_none.hbs > 11635 Jul 24 16:07 pw_hint_none.html.hbs > 12383 Jul 24 16:07 pw_hint_some.html.hbs > 553 Jul 24 16:07 send_org_invite.hbs > 13190 Jul 24 17:07 send_org_invite.html.hbs do you see something wrong ? should I need to create my own docker image ? thank you for any tips,
kerem closed this issue 2026-03-03 01:28:15 +03:00
Author
Owner

@dani-garcia commented on GitHub (Jul 30, 2019):

I think the templates need to be in a email subfolder, so: bw-data/templates/email/<name>.hbs

<!-- gh-comment-id:516510898 --> @dani-garcia commented on GitHub (Jul 30, 2019): I think the templates need to be in a email subfolder, so: `bw-data/templates/email/<name>.hbs`
Author
Owner

@soyezcloud commented on GitHub (Jul 30, 2019):

even with
/bw-data-sv/templates/email/*.hbs
/data/templates/email/*.hbs file, the template won't load ,

the log returns always

[2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Wrote: DATA
[2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Read: 354 End data with .
[2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Wrote: Subject: Join organisation.comTo:

and we have modified the subject in hbs file for "joignez-vous" (french translation),
and as you can see, the default subject "Join.." appears.

Should I need to create my own docker image?

<!-- gh-comment-id:516564255 --> @soyezcloud commented on GitHub (Jul 30, 2019): even with `/bw-data-sv/templates/email/*.hbs` `/data/templates/email/*.hbs` file, the template won't load , the log returns always > [2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Wrote: DATA<CRLF> > [2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Read: 354 End data with <CR><LF>.<CR><LF><CRLF> > [2019-07-30 19:31:25][lettre::smtp::client][DEBUG] Wrote: Subject: Join organisation.com<CRLF>To: and we have modified the subject in hbs file for "joignez-vous" (french translation), and as you can see, the default subject "Join.." appears. Should I need to create my own docker image?
Author
Owner

@dani-garcia commented on GitHub (May 13, 2020):

Closed due to inactivity.

<!-- gh-comment-id:628269326 --> @dani-garcia commented on GitHub (May 13, 2020): Closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#350
No description provided.