Back

[SOLVED]Modify default email templates in appwrite 1.3.8

  • 2
  • General
  • Accounts
zjjt
29 Jul, 2023, 17:42

Browsing the support, i ve read that it was possible to modify the default html templates for emails. I d like to add my company branding to it and hide the links behind buttons. Unfortunately the way proposed no longer works as the appwrite-worker-email service no longer have the volume sub section in the docker-compose.yml file. I have also tried replacing the file directly in the running container and restarting it but although the file is updated successfully, the emails i receive still contains the same defaults. Please help out if you know how can this be done with the current appwrite version

TL;DR
The user is trying to modify the default email templates in Appwrite 1.3.8 to add their company branding and change the links to buttons. They tried modifying the docker-compose.yml file and replacing the file directly in the running container but it didn't work. Solution: Use a docker-compose.override.yml file instead of modifying the provided one and mount the email-base.tpl file inside the appwrite container.
Drake
29 Jul, 2023, 17:46

You shouldn't be mounting into the mails worker. It should be in appwrite container

zjjt
29 Jul, 2023, 20:55

@Steven yeah I don't know if I misinterpreted what was said in the other thread but when I searched the docker-compose file to mount the file under the volumes I couldn't. I'll check the appwrite container and see if I can modify its volumes

kathelia.dokgu
29 Jul, 2023, 20:59

I was wondering the same thing - I wanted to update the email templates by adding my logo and using CTA buttons instead of just plain links.

Drake
29 Jul, 2023, 21:21

You can add volumes under your appwrite service. I'd actually recommend using a docker-compose.override.yml file instead of modifying the one provided by Appwrite

zjjt
29 Jul, 2023, 21:24

@kathelia.dokgu stay for the ride maybe we ll get to the bottom of this and won't have to wait for appwrite 1.4 at all @Steven ok I'll do that and revert hopefully i get it right

hamed
29 Jul, 2023, 22:01

I hope someone will give a clear guide to this matter 😴

zjjt
31 Jul, 2023, 08:55

Good day all, ill revert back today with my findings

zjjt
1 Aug, 2023, 22:02

@Steven it seems that it is not currently possible to do without cloning the repo

Drake
1 Aug, 2023, 22:54

why?

zjjt
3 Aug, 2023, 11:13

@Steven i fail at pointing appwrite to the right location i guess. Sorry for the late reply i was traveling. Where exactly should i point the email-base.tpl inside the appwrite container ?

zjjt
3 Aug, 2023, 11:41

@Steven @hamed @kathelia.dokgu ive managed to get it working. As Steven said it is indeed the appwrite container which needs to be modified by replacing the default email-base.tpl file. Find below the screenshot of how i did it in my docker-compose.yml file.

zjjt
3 Aug, 2023, 11:42

[SOLVED]Modify default email templates in appwrite 1.3.8

hamed
3 Aug, 2023, 12:21

@zjjt Couldn't locate it.

zjjt
3 Aug, 2023, 12:24

@hamed look for the line 62 in the docker-compose.yml file and mount your volume there. for the email-base.tpf file here is its contents modified for my testing:

zjjt
3 Aug, 2023, 12:25

content of my appwrite folder

zjjt
3 Aug, 2023, 12:26

you have to create the email-base.tpl file

zjjt
3 Aug, 2023, 12:28

here is how it looks like when delivered

hamed
3 Aug, 2023, 12:29

By default, there's no mounted tpl file at that line?

zjjt
3 Aug, 2023, 13:49

@hamed yes there is nothing there by default

hamed
3 Aug, 2023, 14:03

@zjjt It actually worked, thanks ❤️ , I wonder if we're going to mount it again after each version upgrade

zjjt
3 Aug, 2023, 14:05

@hamed from what i could gather, the next major version should have a template editor right in the console thus we would not need the current method anymore.But for safety i ll keep it around in my docker-compose so that it always boots up with it

Drake
3 Aug, 2023, 16:35

instead of putting ~/appwrite, you can use relative paths like ./email/email-base.tpl

Also, next step, is to use a docker-compose.override.yml file instead of modifying your docker-compose.yml file 😉

Drake
3 Aug, 2023, 16:36

so if you use a docker-compose.override.yml file, even if the docker-compose.yml file is upgraded, it will still mount

zjjt
3 Aug, 2023, 16:36

@Steven you are right in a hurry I forgot about your advice to use the override...thanks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more