Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Conversation

gewenyu99
Copy link
Contributor

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@gewenyu99 gewenyu99 requested a review from lohanidamodar May 8, 2023 22:01
<tbody>
<tr>
<td>Sender name</td>
<td>[TODO: @damodar where is this used?].</td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</tr>
<tr>
<td>Sender email</td>
<td>[TODO: @damodar which part of this can be configured? Does it have to do with the SMTP configuration?].</td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whole email is configurable, but they should be careful, as the SMTP config should allow this email as the sender email. And whole custom email templates can only be changed when custom SMTP configuration is setup

</tr>
<tr>
<td>Reply to</td>
<td>[TODO: @damodar Where is this displayed, if empty is no reply?].</td>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used as email's reply to address. If empty it's not used.

</tbody>
</table>
<h3><a href="#email-template-syntax" id="email-template-syntax">Email Template Syntax</a></h3>
<p>[TODO: @damodar are these variables accessible only in the Message tempalte or also the other components?]</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not decided yet, for now let's say only Message

<li>In your project, navigate to the <b>Auth</b> service.</li>
<li>Under the <b>Auth</b> service, navigate to the <b>Templates</b> tab.</li>
<li>Expand the email template you want to edit.</li>
<li>Select the <b>Template language</b> [TODO: @damodar is this used for localization? Can you configure a different template for each language?].</li>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the idea, each language will have different SMSs and Emails templates

Copy link
Member

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replied to all the comments.

@gewenyu99 gewenyu99 requested a review from lohanidamodar May 18, 2023 22:23
@gewenyu99 gewenyu99 marked this pull request as ready for review May 18, 2023 22:23
@gewenyu99
Copy link
Contributor Author

@lohanidamodar Please review again, anything missing from this?

Copy link
Member

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I think the SMS template section is missing ?

@gewenyu99
Copy link
Contributor Author

Looks good, but I think the SMS template section is missing ?

Ooooo We're also doing SMS this release?

@gewenyu99 gewenyu99 requested a review from lohanidamodar May 25, 2023 17:26
@gewenyu99
Copy link
Contributor Author

gewenyu99 commented May 25, 2023

OBSOLETE COMMENT

@eldadfux
Copy link
Member

eldadfux commented Jun 4, 2023

Leftover:
image

@eldadfux
Copy link
Member

eldadfux commented Jun 4, 2023

I think we should also change the title to match the navigation link. This page will also create confusion with the existing SMS delivery page. I suggest we add a comment on both pages, warning readers in case they're looking for the other page.

<p>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.</p>

<h2><a href="#customize" id="customize">Customize Templates</a></h2>
<p>You can customize email templates in the Appwrite console.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>You can customize email templates in the Appwrite console.</p>
<p>You can customize email templates for each of your projects in the Appwrite console. </p>

@@ -0,0 +1,128 @@
<p>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.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page is mostly focused on emails, while we also support SMS templates and maybe other in the future, we need to make the docs more balanced. I would also mention you can customize them per project and for multiple languages at the top of the page linking to more information on how to manage localization in Appwrite.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might even add a table of content for quick links to emails vs sms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Localization might be worth its own section with a code example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 Some of these sections are new, for a while I thought SMS delivery wasn't going to be added yet.

@eldadfux
Copy link
Member

eldadfux commented Jun 4, 2023

I think we could also benefit from a console screenshot here.

Copy link
Member

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left comments

@@ -0,0 +1,145 @@
<p>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.</p>

<p>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]</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how this should go yet, for now we could just keep up to. We don't yet have method to set locale in projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is client.setLocale method that set's the locale header X-Appwrite-Locale, which then determines which local to use.

</table>

<h3><a href="#email-template-examples" id="email-template-components">Email Template Components</a></h3>
[TODO: @dlohani once we're ready, let's do examples for each type of template (maybe also what it would look like rendered)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by Email Template components?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its' console UI, then Arman already has it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by Email Template components?

Sorry, I mean email template Examples

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be ready, you can check with @ArmanNik


<h2>Localization</h2>
[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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we would just describe how users would set their templates, then show the same message for an email template in two languages + screenshots.

This just fully demonstrates how localization works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by using client.setLocale to set the locale header.

@gewenyu99 gewenyu99 changed the base branch from main to 1.4.x August 23, 2023 20:43
&lt/html&gt</code></pre>
</div>

<h2><a href="#sms-templates" id="sms-templates">SMS Templates</a></h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not mention SMS templates. This section should be gone, and in introduction we shouldn't talk about it.

We disabled this feature for now. We will add it back when we add support for custom SMS provider.

Copy link
Contributor

@Meldiron Meldiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the suggestions I provided, this LGTM. Only accept those that make sense to you as well.

Vincent (Wen Yu) Ge and others added 6 commits August 25, 2023 14:08
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
Co-authored-by: Matej Bačo <matejbaco2000@gmail.com>
@gewenyu99 gewenyu99 requested a review from Meldiron August 25, 2023 19:03
@gewenyu99
Copy link
Contributor Author

localhost_2080_docs_email-and-sms-templates (1)

@gewenyu99 gewenyu99 merged commit c292ef6 into 1.4.x Aug 29, 2023
@gewenyu99 gewenyu99 deleted the smtp-templates branch September 3, 2023 15:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants