From 01585c2c88c226efb73036ef378427839d4c5013 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 28 Mar 2023 22:11:22 +0000 Subject: [PATCH 01/24] Init SMTP template docs --- app/views/docs/email-and-sms-templates.phtml | 22 ++++++++++++++++++++ app/views/docs/index.phtml | 1 + 2 files changed, 23 insertions(+) create mode 100644 app/views/docs/email-and-sms-templates.phtml diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml new file mode 100644 index 000000000..7a2b26ac7 --- /dev/null +++ b/app/views/docs/email-and-sms-templates.phtml @@ -0,0 +1,22 @@ +

Appwrite uses emails and SMS messages to perform user invite, user verification, login, and reset password. Emails and SMS messages can be customized to fit your app's design and voice.

+ +

Customize Templates

+

You can customize email and SMS templates in the Appwrite console.

+
+

Custom SMTP Server Required

+

The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

+
+
    +
  1. In your project, navigate to Auth > Templates.
  2. + [STEPS AFTER FINALIZED DESIGN] +
+

Email Templates

+ +

Email Template Syntax

+

Email Template Components

+ + +

SMS Templates

+ +

SMS Template Syntax

+

SMS Template Components

\ No newline at end of file diff --git a/app/views/docs/index.phtml b/app/views/docs/index.phtml index 998d36cfe..0265e8178 100644 --- a/app/views/docs/index.phtml +++ b/app/views/docs/index.phtml @@ -106,6 +106,7 @@ $cols = [
  • Pagination
  • Webhooks
  • Custom Domains
  • +
  • Email and SMS Templates
  • Response Codes
  • Rate Limits
  • From d61ac645554729f531023c47a7562ddbb62c8a4a Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 5 May 2023 22:37:03 +0000 Subject: [PATCH 02/24] Use relative links --- app/views/docs/email-and-sms-templates.phtml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 7a2b26ac7..35cbce5cd 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,22 +1,22 @@

    Appwrite uses emails and SMS messages to perform user invite, user verification, login, and reset password. Emails and SMS messages can be customized to fit your app's design and voice.

    -

    Customize Templates

    +

    Customize Templates

    You can customize email and SMS templates in the Appwrite console.

    Custom SMTP Server Required

    -

    The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

    +

    The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

    1. In your project, navigate to Auth > Templates.
    2. [STEPS AFTER FINALIZED DESIGN]
    -

    Email Templates

    +

    Email Templates

    +

    Add a SMTP provider

    +

    Email Template Syntax

    +

    Email Template Components

    -

    Email Template Syntax

    -

    Email Template Components

    +

    SMS Templates

    -

    SMS Templates

    - -

    SMS Template Syntax

    -

    SMS Template Components

    \ No newline at end of file +

    SMS Template Syntax

    +

    SMS Template Components

    \ No newline at end of file From 0c444f7d0daebcdfdfa61004e41fb0ccf7cbdbbb Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Mon, 8 May 2023 22:00:28 +0000 Subject: [PATCH 03/24] Add placeholders for docs --- app/views/docs/email-and-sms-templates.phtml | 78 +++++++++++++++++--- 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 35cbce5cd..e776e3c84 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,22 +1,76 @@ -

    Appwrite uses emails and SMS messages to perform user invite, user verification, login, and reset password. Emails and SMS messages can be customized to fit your app's design and voice.

    +

    Appwrite uses emails messages to perform user invite, user verification, login, and reset password. Emails messages can be customized to fit your app's design and voice.

    Customize Templates

    -

    You can customize email and SMS templates in the Appwrite console.

    +

    You can customize email templates in the Appwrite console.

    Custom SMTP Server Required

    The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

      -
    1. In your project, navigate to Auth > Templates.
    2. - [STEPS AFTER FINALIZED DESIGN] +
    3. In your project, navigate to the Auth service.
    4. +
    5. Under the Auth service, navigate to the Templates tab.
    6. +
    7. Expand the email template you want to edit.
    8. +
    9. Select the Template language [TODO: @damodar is this used for localization? Can you configure a different template for each language?].
    10. +
    11. Update the email template fields and click **Update** to save your changes.

    Email Templates

    -

    Add a SMTP provider

    -

    Email Template Syntax

    -

    Email Template Components

    +

    You can customize the email emplates for account verification, magic-url authentication, password resets, and user invites.

    +

    Email Template Components

    +

    Each email templates has the following components that you can customize.

    +

    Permission Types

    +

    In Client and Server SDKs, you will find a Permission class with helper methods for each role described below.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ComponentDescription
    Sender name[TODO: @damodar where is this used?].
    Sender email[TODO: @damodar which part of this can be configured? Does it have to do with the SMTP configuration?].
    Reply to[TODO: @damodar Where is this displayed, if empty is no reply?].
    SubjectThe title of the email.
    MessageThe body of the email. You can find the variables available in the Email Template Syntax section.
    +

    Email Template Syntax

    +

    [TODO: @damodar are these variables accessible only in the Message tempalte or also the other components?]

    - -

    SMS Templates

    - -

    SMS Template Syntax

    -

    SMS Template Components

    \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + +
    ComponentDescription
    {{project}}The project name.
    {{team}}Thee project team's name.
    {{user}}The name of the uer receiving the email.
    \ No newline at end of file From 703d2c36971b877dd078d864520a7bd4b0d1454e Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 18 May 2023 22:23:08 +0000 Subject: [PATCH 04/24] Update email template docs with Damodar's comments --- app/views/docs/email-and-sms-templates.phtml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index e776e3c84..c5a64819e 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -10,7 +10,7 @@
  • In your project, navigate to the Auth service.
  • Under the Auth service, navigate to the Templates tab.
  • Expand the email template you want to edit.
  • -
  • Select the Template language [TODO: @damodar is this used for localization? Can you configure a different template for each language?].
  • +
  • Select the Template language. You can have a different template for each language your app supports.
  • Update the email template fields and click **Update** to save your changes.
  • Email Templates

    @@ -29,15 +29,15 @@ Sender name - [TODO: @damodar where is this used?]. + Readers will see this as display name of the sender. Sender email - [TODO: @damodar which part of this can be configured? Does it have to do with the SMTP configuration?]. + Readers will see this as the displayed email of the sender. This must be a valid email for the SMTP provider your configured. Reply to - [TODO: @damodar Where is this displayed, if empty is no reply?]. + Readers will reply to this email adress instead of the sender address. You can leave this field empty if unused. Subject @@ -50,7 +50,7 @@

    Email Template Syntax

    -

    [TODO: @damodar are these variables accessible only in the Message tempalte or also the other components?]

    +

    Variables can be used in email templates to dynamically format unique emails for each reader. These variables can only be accessed in the Message field of the email template.

    From 5b880ecc121613a21871b9e854fd041cf29fd7c4 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 24 May 2023 21:33:20 +0000 Subject: [PATCH 05/24] Add SMS into the templates page --- app/views/docs/email-and-sms-templates.phtml | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index c5a64819e..c137a6053 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -73,4 +73,52 @@ +
    The name of the uer receiving the email.
    + +

    SMS Templates

    +

    You can customize the SMS emplates used for phone verification and login.

    +

    SMS Template Components

    + + + + + + + + + + + + + +
    ComponentDescription
    MessageThe body of the SMS message. You can find the variables available in the SMS Template Syntax section.
    + +

    SMS Template Syntax

    +

    Variables can be used in SMS templates to dynamically format unique messages for each reader.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ComponentDescription
    {{project}}The project name.
    {{team}}Thee project team's name.
    {{user}}The name of the uer receiving the email.
    {{passcode}}The secret code sent to users for phone verification or authentication.
    \ No newline at end of file From 455b4bf9972413d4b934838422fb2a27c43e230f Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 25 May 2023 18:06:30 +0000 Subject: [PATCH 06/24] Fix table heading for variables --- app/views/docs/email-and-sms-templates.phtml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index c137a6053..b07c012a8 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -55,7 +55,7 @@ - + @@ -70,7 +70,11 @@ - + + + + +
    ComponentVariable Description
    {{user}}The name of the uer receiving the email.The name of the user receiving the email.
    {{redirect}}The URL for the user to complete the email template's action.
    @@ -99,7 +103,7 @@ - + From 2319af04424ed31b837390e13bf4fa409c2013ef Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Mon, 5 Jun 2023 20:54:26 +0000 Subject: [PATCH 07/24] Added more to template docs --- app/views/docs/email-and-sms-templates.phtml | 27 ++++++++++++++++---- app/views/docs/main.phtml | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index b07c012a8..db89e7ff9 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,7 +1,16 @@ -

    Appwrite uses emails messages to perform user invite, user verification, login, and reset password. Emails messages can be customized to fit your app's design and voice.

    +

    Appwrite uses email and SMS messages to communicate with users to perform authentication actions. Emails and SMS messages can be customized to fit your app's design and voice.

    + +

    Each Appwrite project can have its own set of unique templates. Templates also support localization, every template can be written in multiple languages and served depending on the [TODO: @dlohani]

    + +

    +Email Templates +

    +

    +SMS Templates +

    Customize Templates

    -

    You can customize email templates in the Appwrite console.

    +

    You can customize email templates for each of your projects in the Appwrite console.

    Custom SMTP Server Required

    The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

    @@ -17,8 +26,6 @@

    You can customize the email emplates for account verification, magic-url authentication, password resets, and user invites.

    Email Template Components

    Each email templates has the following components that you can customize.

    -

    Permission Types

    -

    In Client and Server SDKs, you will find a Permission class with helper methods for each role described below.

    ComponentVariable Description
    @@ -79,6 +86,9 @@
    +

    Email Template Components

    +[TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)] +

    SMS Templates

    You can customize the SMS emplates used for phone verification and login.

    SMS Template Components

    @@ -125,4 +135,11 @@ The secret code sent to users for phone verification or authentication. - \ No newline at end of file + + +

    SMS Template Components

    +[TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)] + +

    Localization

    +[TODO: @dlohani short description of how it's decided which language's template is sent] +[TODO: @dlohani Maybe example of a template in two languages? (maybe also what it would look like rendered)] diff --git a/app/views/docs/main.phtml b/app/views/docs/main.phtml index 8c4db0f2e..373d4ab51 100644 --- a/app/views/docs/main.phtml +++ b/app/views/docs/main.phtml @@ -94,7 +94,7 @@ $getSpecsUrl = function($type, $platform) use ($latestVersion) {

    API References

    -

    The Appwrite API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded or JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

    +

    The Appwrite API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded or JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

    Specifications for the Appwrite API are available in multiple formats, including Open API 3 for clients or servers and Swagger2 for clients or servers.

    From 4a01a388818458d01e516370e8e473f1d3b08eee Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 6 Jun 2023 11:19:07 -0400 Subject: [PATCH 08/24] Update app/views/docs/email-and-sms-templates.phtml --- app/views/docs/email-and-sms-templates.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index db89e7ff9..55e83a8a5 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -137,7 +137,7 @@ -

    SMS Template Components

    +

    SMS Template Examples

    [TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)]

    Localization

    From 601dd293f7df9e8dbe891dd357322c8051b80f56 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 6 Jun 2023 11:19:14 -0400 Subject: [PATCH 09/24] Update app/views/docs/email-and-sms-templates.phtml --- app/views/docs/email-and-sms-templates.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 55e83a8a5..5ac15bbe5 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -86,7 +86,7 @@ -

    Email Template Components

    +

    Email Template Examples

    [TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)]

    SMS Templates

    From 6158cf8a5c8ef3b5b81b17d12498eb6f2877107b Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 7 Jun 2023 19:56:39 +0000 Subject: [PATCH 10/24] Update event object's attribute key names --- app/views/docs/events.phtml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/docs/events.phtml b/app/views/docs/events.phtml index 2595ebbe0..5af83980b 100644 --- a/app/views/docs/events.phtml +++ b/app/views/docs/events.phtml @@ -20,8 +20,8 @@ $events = $this->getParam('events', []); @@ -53,8 +53,8 @@ $events = $this->getParam('events', []); @@ -86,8 +86,8 @@ $events = $this->getParam('events', []); @@ -120,8 +120,8 @@ $events = $this->getParam('events', []); From ee683aab0cdb06c86a20d2891a9ae6135cb0e830 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 9 Jun 2023 15:32:46 +0000 Subject: [PATCH 11/24] attribute model page --- app/views/docs/attribute-model | 70 ++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 app/views/docs/attribute-model diff --git a/app/views/docs/attribute-model b/app/views/docs/attribute-model new file mode 100644 index 000000000..0cf62d0f0 --- /dev/null +++ b/app/views/docs/attribute-model @@ -0,0 +1,70 @@ +

    Properties

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    keystringAttribute key.
    typestringAttribute type.
    statusstringAttribute status. Possible values: available, processing, deleting, stuck, or failed
    requiredbooleanIs attribute required?
    arraybooleanIs attribute an array?
    + +

    Examples

    + +

    This is a generic attribute model that specific attribute types implement. For examples, view a specific attribute models.

    +

    +attributeBoolean +

    +

    +attributeInteger +

    +

    +attributeFloat +

    +

    +attributeEmail +

    +

    +attributeEnum +

    +

    +attributeUrl +

    +

    +attributeIp +

    +

    +attributeDatetime +

    +

    +attributeRelationship +

    +

    +attributeString +

    \ No newline at end of file From b0d10a9433a625610f8ccdea4cca91cdb5094ba0 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 9 Jun 2023 17:19:25 +0000 Subject: [PATCH 12/24] Fix file format for attribute model --- app/views/docs/{attribute-model => attribute-model.phtml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/views/docs/{attribute-model => attribute-model.phtml} (100%) diff --git a/app/views/docs/attribute-model b/app/views/docs/attribute-model.phtml similarity index 100% rename from app/views/docs/attribute-model rename to app/views/docs/attribute-model.phtml From 356230913ad6829092203d58cfab6fd1b254a3be Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 9 Jun 2023 18:01:48 +0000 Subject: [PATCH 13/24] Update copy --- app/views/docs/attribute-model.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/attribute-model.phtml b/app/views/docs/attribute-model.phtml index 0cf62d0f0..c596dbb64 100644 --- a/app/views/docs/attribute-model.phtml +++ b/app/views/docs/attribute-model.phtml @@ -37,7 +37,7 @@

    Examples

    -

    This is a generic attribute model that specific attribute types implement. For examples, view a specific attribute models.

    +

    Appwrite has many types of attributes that extend the properties of this generic attribute object. To view examples, visit the page for your specific attribute type.

    attributeBoolean

    From dbe2e9f8ba3f2a7f2319f1fdaeaac0382a97c561 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 1 Aug 2023 14:53:04 +0000 Subject: [PATCH 14/24] Fix Damodar's comments --- app/views/docs/email-and-sms-templates.phtml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 5ac15bbe5..7511ce244 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,6 +1,10 @@

    Appwrite uses email and SMS messages to communicate with users to perform authentication actions. Emails and SMS messages can be customized to fit your app's design and voice.

    -

    Each Appwrite project can have its own set of unique templates. Templates also support localization, every template can be written in multiple languages and served depending on the [TODO: @dlohani]

    +

    + Each Appwrite project can have its own set of unique templates. + Templates also support localization, every template can be written in multiple languages and served + depending on the configured locale. +

    Email Templates @@ -141,5 +145,5 @@ [TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)]

    Localization

    -[TODO: @dlohani short description of how it's decided which language's template is sent] +

    You can configure localization by settling locale with client.setLocale in the SDKs or the X-Appwrite-Locale HTTP header.

    [TODO: @dlohani Maybe example of a template in two languages? (maybe also what it would look like rendered)] From a43a6d62b94044db140b357eab1efcf24acbc745 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 16 Aug 2023 09:06:27 -0700 Subject: [PATCH 15/24] Fix the repo url for apple sdk in getting started for apple --- app/views/docs/getting-started-for-apple.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/getting-started-for-apple.phtml b/app/views/docs/getting-started-for-apple.phtml index fc6ce3038..88e7d102a 100644 --- a/app/views/docs/getting-started-for-apple.phtml +++ b/app/views/docs/getting-started-for-apple.phtml @@ -43,7 +43,7 @@ $appleVersion = $versions['apple'] ?? '';
    dependencies: [
         .package(
             name: "Appwrite",
    -        url: "https://github.com/appwrite/sdk-for-swift",
    +        url: "https://github.com/appwrite/sdk-for-apple",
             .exact("escape($appleVersion); ?>")
         )
     ]')
    From 99c3600dba5c0a864c67f9f10d8327b9f0b29c12 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 23 Aug 2023 19:19:20 +0000 Subject: [PATCH 16/24] Add locale examples --- app/views/docs/email-and-sms-templates.phtml | 165 +++++++++++++++++-- 1 file changed, 148 insertions(+), 17 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 7511ce244..d0b0fc21d 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -91,7 +91,56 @@

    Email Template Examples

    -[TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)] +

    Here's an example of using these variables in a template.

    +
    +
    <!doctype html>
    +<html>
    +
    +<head>
    +    <style>
    +        ... your style here
    +    </style>
    +</head>
    +
    +<body style="direction: ltr">
    +
    +<div style="max-width:650px; word-wrap: break-wrod; overflow-wrap: break-word;
    +  word-break: break-all; margin:0 auto;">
    +    <table style="margin-top: 32px">
    +        <tr>
    +            <td>
    +                <h1>
    +                    {{subject}}
    +                </h1>
    +            </td>
    +        </tr>
    +    </table>
    +
    +    <table style="margin-top: 40px">
    +        <tr>
    +            <td>
    +                <p>Hello </p>
    +
    +                <p>Follow this link to reset your {{project}} password.</p>
    +
    +                <a href="{{redirect}}" target="_blank">{{redirect}}</a>
    +
    +                <p><br />If you didn't ask to reset your password, you can ignore this message.</p>
    +                <br />
    +
    +                <p>Thanks
    +                <br />
    +                {{project}} team
    +                </p>
    +            </td>
    +        </tr>
    +    </table>
    +</div>
    +
    +</body>
    +
    +</html>
    +

    SMS Templates

    You can customize the SMS emplates used for phone verification and login.

    @@ -123,27 +172,109 @@ - {{project}} - The project name. - - - {{team}} - Thee project team's name. - - - {{user}} - The name of the uer receiving the email. - - - {{passcode}} + {{token}} The secret code sent to users for phone verification or authentication.

    SMS Template Examples

    -[TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)] +

    Here's an example of using these variables in a template.

    +
    +
    Your account verification code is {{token}}
    +
    +

    Localization

    -

    You can configure localization by settling locale with client.setLocale in the SDKs or the X-Appwrite-Locale HTTP header.

    -[TODO: @dlohani Maybe example of a template in two languages? (maybe also what it would look like rendered)] +

    + Each template can have multiple supported locales, displayed in different format and language. + This can be configured under the Template language selector of each template. +

    + +

    + You can send messages in different localizations by settling locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header. +

    + +

    For example, you can send a phone verification in French.

    +
      +
    • +

      Web

      +
      +
      import { Client, Account } from "appwrite";
      +
      +const client = new Client();
      +
      +const account = new Account(client);
      +
      +client
      +    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
      +    .setProject('5df5acd0d48c2')                 // Your project ID
      +    .setLocale('fr')                             // Your locale
      +;
      +
      +const promise = account.createPhoneVerification();
      +
      +promise.then(function (response) {
      +    console.log(response); // Success
      +}, function (error) {
      +    console.log(error); // Failure
      +});
      +
      +
    • +
    • +

      Flutter

      +
      +
      import 'package:appwrite/appwrite.dart';
      +
      +void main() { // Init SDK
      +  Client client = Client();
      +  Account account = Account(client);
      +
      +  client
      +    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
      +    .setProject('5df5acd0d48c2')                 // Your project ID
      +    .setLocale('fr')                             // Your locale
      +  ;
      +  Future result = account.createPhoneVerification();
      +
      +  result
      +    .then((response) {
      +      print(response);
      +    }).catchError((error) {
      +      print(error.response);
      +  });
      +}
      +
      +
    • +
    • +

      Android

      +
      +
      import io.appwrite.Client
      +import io.appwrite.services.Account
      +
      +val client = Client(context)
      +    .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
      +    .setProject("5df5acd0d48c2")                 // Your project ID
      +    .setLocale('fr')                             // Your locale
      +
      +val account = Account(client)
      +
      +val response = account.createPhoneVerification()
      +
      +
    • +
    • +

      Apple

      +
      +
      import Appwrite
      +
      +let client = Client()
      +    .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
      +    .setProject("5df5acd0d48c2")                 // Your project ID
      +    .setLocale('fr')                             // Your locale
      +
      +let account = Account(client)
      +
      +let token = try await account.createPhoneVerification()
      +
      +
    • +
    \ No newline at end of file From 82fe4846541d966b370d1234cfb931138d95684f Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Wed, 23 Aug 2023 19:28:06 +0000 Subject: [PATCH 17/24] chat GPT helps me spell! --- app/views/docs/email-and-sms-templates.phtml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index d0b0fc21d..1d4ec7c15 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -27,7 +27,7 @@
  • Update the email template fields and click **Update** to save your changes.
  • Email Templates

    -

    You can customize the email emplates for account verification, magic-url authentication, password resets, and user invites.

    +

    You can customize the email templates for account verification, magic-url authentication, password resets, and user invites.

    Email Template Components

    Each email templates has the following components that you can customize.

    @@ -44,11 +44,11 @@ - + - + @@ -77,7 +77,7 @@ - + @@ -104,7 +104,7 @@ <body style="direction: ltr"> -<div style="max-width:650px; word-wrap: break-wrod; overflow-wrap: break-word; +<div style="max-width:650px; word-wrap: break-word; overflow-wrap: break-word; word-break: break-all; margin:0 auto;"> <table style="margin-top: 32px"> <tr> @@ -143,7 +143,7 @@

    SMS Templates

    -

    You can customize the SMS emplates used for phone verification and login.

    +

    You can customize the SMS templates used for phone verification and login.

    SMS Template Components

    Sender emailReaders will see this as the displayed email of the sender. This must be a valid email for the SMTP provider your configured.Readers will see this as the displayed email of the sender. This must be a valid email for the SMTP provider you've configured.
    Reply toReaders will reply to this email adress instead of the sender address. You can leave this field empty if unused.Readers will reply to this email address instead of the sender address. You can leave this field empty if unused.
    Subject
    {{team}}Thee project team's name.The project team's name.
    {{user}}
    @@ -184,15 +184,15 @@
    Your account verification code is {{token}}
    +

    Localization

    -

    Localization

    Each template can have multiple supported locales, displayed in different format and language. This can be configured under the Template language selector of each template.

    - You can send messages in different localizations by settling locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header. + You can send messages in different localizations by setting the locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header.

    For example, you can send a phone verification in French.

    From b5dd0689288869e94b36dd1afd00be3af8fb21f9 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 14:08:56 -0400 Subject: [PATCH 18/24] Update app/views/docs/email-and-sms-templates.phtml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/views/docs/email-and-sms-templates.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 1d4ec7c15..63730e086 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -2,7 +2,7 @@

    Each Appwrite project can have its own set of unique templates. - Templates also support localization, every template can be written in multiple languages and served + Templates also support localization, so every template can be written in multiple languages and served depending on the configured locale.

    From e6b6fee0da3a75ab50a768b456761a821940e870 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 14:09:06 -0400 Subject: [PATCH 19/24] Update app/views/docs/email-and-sms-templates.phtml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/views/docs/email-and-sms-templates.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index 63730e086..bb6b6b4d6 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,4 +1,4 @@ -

    Appwrite uses email and SMS messages to communicate with users to perform authentication actions. Emails and SMS messages can be customized to fit your app's design and voice.

    +

    Appwrite uses email and SMS messages to communicate with users to perform authentication and verification actions. Emails and SMS messages can be customized to fit your app's design and voice.

    Each Appwrite project can have its own set of unique templates. From 9249017aa0c8d6eafe3dbb8c24b8606eda8adee4 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 14:11:47 -0400 Subject: [PATCH 20/24] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/views/docs/email-and-sms-templates.phtml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index bb6b6b4d6..c7a723c36 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -17,7 +17,7 @@

    You can customize email templates for each of your projects in the Appwrite console.

    Custom SMTP Server Required

    -

    The built-in email service does not support custom email templates. Configure a custom SMTP server to enable custom email templates.

    +

    The built-in email service does not support custom email templates to prevent malicious templates. Configure a custom SMTP server to enable custom email templates.

    1. In your project, navigate to the Auth service.
    2. @@ -40,15 +40,15 @@
    - + - + - + @@ -56,12 +56,12 @@ - +
    Sender nameReaders will see this as display name of the sender.Readers will see this as a display name of the sender.
    Sender emailReaders will see this as the displayed email of the sender. This must be a valid email for the SMTP provider you've configured.Readers will see this as a display email of the sender. This email must be authenticated on the SMTP provider you've configured, otherwise it will be delivered to the spam folder. This usually means the email must end with the same domain as your SMTP username.
    Reply toReaders will reply to this email address instead of the sender address. You can leave this field empty if unused.Readers will reply to this email address instead of the sender address. You can leave this field empty, and the sender email will be used automatically.
    Subject
    MessageThe body of the email. You can find the variables available in the Email Template Syntax section.The body of the email in HTML format. You can find the variables available in the Email Template Syntax section.

    Email Template Syntax

    -

    Variables can be used in email templates to dynamically format unique emails for each reader. These variables can only be accessed in the Message field of the email template.

    +

    Variables can be used in email templates to dynamically construct unique emails for each reader. These variables can only be used in the Message field of the email template.

    @@ -81,7 +81,7 @@ - + @@ -192,7 +192,7 @@

    - You can send messages in different localizations by setting the locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header. + You can send messages in different languages by setting the locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header. View here the list of available locales

    For example, you can send a phone verification in French.

    From 5353edfb0505d9e2f8f913f1207e55a2bf84e18d Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 18:39:31 +0000 Subject: [PATCH 21/24] Console capitalized --- app/views/docs/email-and-sms-templates.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index c7a723c36..aed0abe2d 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -14,7 +14,7 @@

    Customize Templates

    -

    You can customize email templates for each of your projects in the Appwrite console.

    +

    You can customize email templates for each of your projects in the Appwrite Console.

    Custom SMTP Server Required

    The built-in email service does not support custom email templates to prevent malicious templates. Configure a custom SMTP server to enable custom email templates.

    From 7844c58d5f6382dc29eb97f608404fbc32bb3f2b Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 18:47:07 +0000 Subject: [PATCH 22/24] remove reference of phone/sms template --- app/views/docs/email-and-sms-templates.phtml | 61 ++------------------ 1 file changed, 6 insertions(+), 55 deletions(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index aed0abe2d..f1327335d 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -1,4 +1,4 @@ -

    Appwrite uses email and SMS messages to communicate with users to perform authentication and verification actions. Emails and SMS messages can be customized to fit your app's design and voice.

    +

    Appwrite uses emails to communicate with users to perform authentication and verification actions. Emails can be customized to fit your app's design and voice.

    Each Appwrite project can have its own set of unique templates. @@ -6,13 +6,6 @@ depending on the configured locale.

    -

    -Email Templates -

    -

    -SMS Templates -

    -

    Customize Templates

    You can customize email templates for each of your projects in the Appwrite Console.

    @@ -142,48 +135,6 @@ </html>
    -

    SMS Templates

    -

    You can customize the SMS templates used for phone verification and login.

    -

    SMS Template Components

    -
    {{user}}The name of the user receiving the email.The name of the user receiving the email. This variable is not available in the Magic URL template, as there might not be a user yet.
    {{redirect}}
    - - - - - - - - - - - - -
    ComponentDescription
    MessageThe body of the SMS message. You can find the variables available in the SMS Template Syntax section.
    - -

    SMS Template Syntax

    -

    Variables can be used in SMS templates to dynamically format unique messages for each reader.

    - - - - - - - - - - - - - - -
    VariableDescription
    {{token}}The secret code sent to users for phone verification or authentication.
    - -

    SMS Template Examples

    -

    Here's an example of using these variables in a template.

    -
    -
    Your account verification code is {{token}}
    -
    -

    Localization

    @@ -195,7 +146,7 @@ You can send messages in different languages by setting the locale with client.setLocale() in the SDKs or the X-Appwrite-Locale HTTP header. View here the list of available locales

    -

    For example, you can send a phone verification in French.

    +

    For example, you can send an email verification in French.

    • Web

      @@ -212,7 +163,7 @@ client .setLocale('fr') // Your locale ; -const promise = account.createPhoneVerification(); +const promise = account.createVerification('https://example.com'); promise.then(function (response) { console.log(response); // Success @@ -235,7 +186,7 @@ void main() { // Init SDK .setProject('5df5acd0d48c2') // Your project ID .setLocale('fr') // Your locale ; - Future result = account.createPhoneVerification(); + Future result = account.createVerification('https://example.com'); result .then((response) { @@ -259,7 +210,7 @@ val client = Client(context) val account = Account(client) -val response = account.createPhoneVerification() +val response = account.createVerification('https://example.com')
    • @@ -274,7 +225,7 @@ let client = Client() let account = Account(client) -let token = try await account.createPhoneVerification() +let token = try await account.createVerification('https://example.com')
    \ No newline at end of file From 24ebe2fd296bf26bf5b1130127a4b2aa1926a687 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Fri, 25 Aug 2023 19:03:44 +0000 Subject: [PATCH 23/24] Fix index --- app/views/docs/index.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/docs/index.phtml b/app/views/docs/index.phtml index 5db26d3dc..8f0bd9a08 100644 --- a/app/views/docs/index.phtml +++ b/app/views/docs/index.phtml @@ -107,7 +107,7 @@ $cols = [
  • Pagination
  • Webhooks
  • Custom Domains
  • -
  • Email and SMS Templates
  • +
  • Email Templates
  • Response Codes
  • Rate Limits
  • From 034de4ad39903e4a761011ed9a58ce04830e67da Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 29 Aug 2023 13:49:28 +0000 Subject: [PATCH 24/24] Add SMTP steps --- app/views/docs/email-and-sms-templates.phtml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/views/docs/email-and-sms-templates.phtml b/app/views/docs/email-and-sms-templates.phtml index f1327335d..e685405f0 100644 --- a/app/views/docs/email-and-sms-templates.phtml +++ b/app/views/docs/email-and-sms-templates.phtml @@ -6,6 +6,26 @@ depending on the configured locale.

    +

    Custom SMTP server

    +

    + Appwrite Cloud has a default SMTP server to get you started. + This SMTP server sends generic emails and doesn't allow customizing SMTP templates. + To use custom SMTP templates, you will need to configure your own SMTP server. +

    + +

    + There are many third-party SMTP providers like SendGrid and Mailgun. + Before proceeding, pick an SMTP provider, create an account, and obtain Sender name, Sender email, Server host, Server port, Username, and Password. +

    + +
      +
    1. Navigate to your project's Settings.
    2. +
    3. Navigate to the SMTP tab.
    4. +
    5. Under SMTP server, toggle Custom SMTP server.
    6. +
    7. Input Sender name, Sender email, Server host, Server port, Username, and Password from your provider.
    8. +
    9. Click Update.
    10. +
    +

    Customize Templates

    You can customize email templates for each of your projects in the Appwrite Console.

    @@ -17,7 +37,7 @@
  • Under the Auth service, navigate to the Templates tab.
  • Expand the email template you want to edit.
  • Select the Template language. You can have a different template for each language your app supports.
  • -
  • Update the email template fields and click **Update** to save your changes.
  • +
  • Update the email template fields and click Update to save your changes.
  • Email Templates

    You can customize the email templates for account verification, magic-url authentication, password resets, and user invites.