mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-11 01:10:09 +03:00
email templates not working for me #2175
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@mprasil commented on GitHub:
Nope, that just reports the matching path
<org_id>being a palceholder.@dani-garcia commented on GitHub:
There should be two files per email, the
<name>.hbsis the original plaintext email, and the newer<name>.html.hbswhich 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.@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
@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
/rootdirectory in ours.@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:
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:
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