Back

How to edit email template?

  • 0
  • Auth
  • Cloud
Zelimir
2 Feb, 2025, 16:09

I already know that we can edit body of email templates in the console, but that still produces somewhat weird HTML output. Sometimes it looks broken in some email clients and I would like to just use plain text or customize full html with my styling. Also it would be great if we could avoid pinging Google in every email since Appwrite injects fonts in final output, maybe just an option to turn this off?

As an example this is part of final email that is sent, which for some reason has 2 <head> elements:

TypeScript
<!doctype html>
<html>
    <head>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap">
        <style>
            body {
                padding: 32px;
                line-height: 1.5;
                color: #616b7c;
                font-size: 15px;
                font-weight: 400;
                font-family: "Inter", sans-serif;
                background-color: #ffffff;
                margin: 0;
                padding: 0;
            }

...
more css
...

    </style>
    </head>

<head>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link
            href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600&display=swap"
            rel="stylesheet">
    <style>
        a { color:currentColor; word-break: break-all; }
        body {
            background-color: #ffffff;
            padding: 32px;
            color: #616B7C;
            font-size: 15px;
            font-family: 'Inter', sans-serif;
            line-height: 150%;
        }

        table {
            width: 100%;
            border-spacing: 0 !important;
        }
...
even more css
...
TL;DR
Developers want to edit email templates without weird HTML output issues. They suggest an option to customize the full HTML or use plain text. They also hope to disable Google font injections to fix rendering problems in email clients. For example, emails are sent with duplicate <head> elements, causing trouble.
Steven
2 Feb, 2025, 16:16

Which template is this?

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