email templates not working for me #2175

Closed
opened 2025-10-09 17:49:09 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @pdarcos on GitHub.

Hi,

I saw the previous ticket (now closed) on this issue and I don't understand why bitwarden_rs keeps using the system default templates instead of mine.

I altered the send_org_invite.hbs file in /root/bitwarden_rs/src/static/templates/email and I made sure to use -e TEMPLATES_FOLDER=/root/bitwarden_rs/src/static/templates in my docker run command, yet all invites still use the system defaults.

What am I doing wrong?

Thanks

Originally created by @pdarcos on GitHub. Hi, I saw the previous ticket (now closed) on this issue and I don't understand why bitwarden_rs keeps using the system default templates instead of mine. I altered the send_org_invite.hbs file in /root/bitwarden_rs/src/static/templates/email and I made sure to use -e TEMPLATES_FOLDER=/root/bitwarden_rs/src/static/templates in my docker run command, yet all invites still use the system defaults. What am I doing wrong? Thanks
OVERLORD added the question label 2025-10-09 17:49:09 +03:00
Author
Owner

@mprasil commented on GitHub:

Nope, that just reports the matching path <org_id> being a palceholder.

@mprasil commented on GitHub: Nope, that just reports the matching path `<org_id>` being a palceholder.
Author
Owner

@dani-garcia commented on GitHub:

There should be two files per email, the <name>.hbs is the original plaintext email, and the newer <name>.html.hbs which is the new HTML emails. I expect that by default most clients would use the HTML emails, so you should make sure to update this second one.

@dani-garcia commented on GitHub: There should be two files per email, the `<name>.hbs` is the original plaintext email, and the newer `<name>.html.hbs` which is the new HTML emails. I expect that by default most clients would use the HTML emails, so you should make sure to update this second one.
Author
Owner

@pdarcos commented on GitHub:

Thanks @dani-garcia

I'm getting the HTML email in my inbox and I've changed the send_org_invite.hbs file which is where the html is set no?

I am using your docker image which I compiled on the server to play around with, and I'm using my own external web-app directory to serve my own media files (using -v /path/to/static/files_directory:/web-vault). Everything seems to work fine for me except for the email templates. Weird.

Looking through the logs I don't see any problems

[2019-02-25 17:13:11][rocket::rocket][INFO] GET /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/users application/json:
[2019-02-25 17:13:11][][INFO] Matched: GET /api/organizations/<org_id>/users (get_org_users)
[2019-02-25 17:13:11][
][INFO] Outcome: Success
[2019-02-25 17:13:11][][INFO] Response succeeded.
[2019-02-25 17:13:37][rocket::rocket][INFO] GET /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/collections application/json:
[2019-02-25 17:13:37][
][INFO] Matched: GET /api/organizations/<org_id>/collections (get_org_collections)
[2019-02-25 17:13:37][][INFO] Outcome: Success
[2019-02-25 17:13:37][
][INFO] Response succeeded.
[2019-02-25 17:14:02][rocket::rocket][INFO] POST /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/users/invite application/json; charset=utf-8:
[2019-02-25 17:14:02][_][INFO] Matched: POST /api/organizations/<org_id>/users/invite (send_invite)
[2019-02-25 17:14:02][bitwarden_rs::config][WARN] RELOADING TEMPLATES
[2019-02-25 17:14:02][bitwarden_rs::config][WARN] RELOADING TEMPLATES
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] connecting to 78.xx.xx.xx:587
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 220 mail.my.domainESMTP Postfix (Debian/GNU)
[2019-02-25 17:14:02][lettre::smtp][INFO] connection established to 78.xx.xx.xx:587
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Wrote: EHLO 978f3574f17d
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 250-mail.my.domain250-PIPELINING250-SIZE 40480000250-VRFY250-ETRN250-STARTTLS250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN
[2019-02-25 17:14:02][lettre::smtp][DEBUG] server mail.my.domainwith {EightBitMime, StartTls}
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Wrote: STARTTLS
[2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 220 2.0.0 Ready to start TLS

@pdarcos commented on GitHub: Thanks @dani-garcia I'm getting the HTML email in my inbox and I've changed the send_org_invite.hbs file which is where the html is set no? I am using your docker image which I compiled on the server to play around with, and I'm using my own external web-app directory to serve my own media files (using -v /path/to/static/files_directory:/web-vault). Everything seems to work fine for me except for the email templates. Weird. Looking through the logs I don't see any problems [2019-02-25 17:13:11][rocket::rocket][INFO] GET /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/users application/json: [2019-02-25 17:13:11][_][INFO] Matched: GET /api/organizations/<org_id>/users (get_org_users) [2019-02-25 17:13:11][_][INFO] Outcome: Success [2019-02-25 17:13:11][_][INFO] Response succeeded. [2019-02-25 17:13:37][rocket::rocket][INFO] GET /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/collections application/json: [2019-02-25 17:13:37][_][INFO] Matched: GET /api/organizations/<org_id>/collections (get_org_collections) [2019-02-25 17:13:37][_][INFO] Outcome: Success [2019-02-25 17:13:37][_][INFO] Response succeeded. [2019-02-25 17:14:02][rocket::rocket][INFO] POST /api/organizations/e6eb1553-1dae-4545-a7ac-169e9bbadf24/users/invite application/json; charset=utf-8: [2019-02-25 17:14:02][_][INFO] Matched: POST /api/organizations/<org_id>/users/invite (send_invite) [2019-02-25 17:14:02][bitwarden_rs::config][WARN] RELOADING TEMPLATES [2019-02-25 17:14:02][bitwarden_rs::config][WARN] RELOADING TEMPLATES [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] connecting to 78.xx.xx.xx:587 [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 220 mail.my.domainESMTP Postfix (Debian/GNU)<CRLF> [2019-02-25 17:14:02][lettre::smtp][INFO] connection established to 78.xx.xx.xx:587 [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Wrote: EHLO 978f3574f17d<CRLF> [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 250-mail.my.domain<CRLF>250-PIPELINING<CRLF>250-SIZE 40480000<CRLF>250-VRFY<CRLF>250-ETRN<CRLF>250-STARTTLS<CRLF>250-ENHANCEDSTATUSCODES<CRLF>250-8BITMIME<CRLF>250 DSN<CRLF> [2019-02-25 17:14:02][lettre::smtp][DEBUG] server mail.my.domainwith {EightBitMime, StartTls} [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Wrote: STARTTLS<CRLF> [2019-02-25 17:14:02][lettre::smtp::client][DEBUG] Read: 220 2.0.0 Ready to start TLS<CRLF>
Author
Owner

@dani-garcia commented on GitHub:

That seems correct, I tested it and it works for me.

Currently we send two versions of the email, the plaintext and the HTML version, so the client chooses which version to show, maybe you are changing the plaintext and seeing the original HTML version instead?

Are you using a custom docker image? I don't remember a /root directory in ours.

@dani-garcia commented on GitHub: That seems correct, I tested it and it works for me. Currently we send two versions of the email, the plaintext and the HTML version, so the client chooses which version to show, maybe you are changing the plaintext and seeing the original HTML version instead? Are you using a custom docker image? I don't remember a `/root` directory in ours.
Author
Owner

@pdarcos commented on GitHub:

Hmmm, could this be it?
[2019-02-25 17:14:02][_][INFO] Matched: POST /api/organizations/<org_id>/users/invite (send_invite)

It seems it's missing the org_id

@pdarcos commented on GitHub: Hmmm, could this be it? [2019-02-25 17:14:02][_][INFO] Matched: POST /api/organizations/<org_id>/users/invite (send_invite) It seems it's missing the org_id
Author
Owner

@pdarcos commented on GitHub:

Yeah, I just confirmed I did change that file too.
I think I might just delete everything and start all over again. I must have screwed something up somewhere.
I'll keep you posted

@pdarcos commented on GitHub: Yeah, I just confirmed I did change that file too. I think I might just delete everything and start all over again. I must have screwed something up somewhere. I'll keep you posted
Author
Owner

@pdarcos commented on GitHub:

I'm going to go ahead and close this since it's likely some error on my side.
I'll reopen it if it shows up again.

Thanks

@pdarcos commented on GitHub: I'm going to go ahead and close this since it's likely some error on my side. I'll reopen it if it shows up again. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2175