#Custom Styled Email Template for Verification

15 messages · Page 1 of 1 (latest)

rotund torrent
#

Hello, I would like to send a custom styled email for verification through Appwrite. While designing and testing with the "Message" tools, I created a template.

I then tried to set it up for email verification, but the content is wrapped inside an HTML wrapper, which breaks the styling. I found older posts suggesting that I can replace the email-base.tpl file in the Appwrite Docker container. I did this, but my emails are still being inserted into the same default template as before.

How can I disable or replace the default styling?

celest zinc
#

Hmm, I implemented custom styles without any issues. You just need to completely replace the default template with your own

rotund torrent
#

hmm maybe i'm doing something wrong, so:

  • version 1.6
  • my docker-compose override:

services: appwrite: volumes: - ./email/email-base.tpl:/usr/src/code/app/config/locale/templates/email-base.tpl:rw

  • and then I have an email folder with an email-base.tpl file in the same forder.
  • after change I restart with docker compose up -d
rotund torrent
#

when I look into the container with docker exec -it appwrite cat /usr/src/code/app/config/locale/templates/email-base.tpl I see that it has been modified with override . But when I generate a verification mail, it uses the old(default) template 😦

celest zinc
rotund torrent
#

I don't see my custom template code anywhere. The content of the console is inserted into the default template.

celest zinc
rotund torrent
#

I have saved my template under email-base.tpl and integrated it with docker override as described above. In the console I only entered the text ‘test’ in the tempalte input window.
The generated email contains the text ‘test’ within the default template and not from what I have saved in email-base.tpl.

celest zinc
#

I recommend using the new templates feature instead of doing it manually

#

With it, you can customize verification, password reset...etc

rotund torrent
#

You mean this one?
I'll have to live with that for now. It uses the template here: https://github.com/appwrite/appwrite/blob/a49c3a33f0fd831423afa7a0b53df2c5d709fc2b/app/config/locale/templates/email-base-styled.tpl
and so I can only use half of my own HTML/CSS.

It would be great if there could be a full HTML mode like in the Messeging function

GitHub

Your backend, minus the hassle. Contribute to appwrite/appwrite development by creating an account on GitHub.

celest zinc
rotund torrent
#

that's true, but the content is inserted here, which means that some things no longer work so well

celest zinc