dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
36.78k stars 1.79k forks source link

custom email templates won't work #544

Closed soyezcloud closed 4 years ago

soyezcloud commented 5 years ago

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,

dani-garcia commented 5 years ago

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

soyezcloud commented 5 years ago

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?

dani-garcia commented 4 years ago

Closed due to inactivity.