diff --git a/app/views/docs/attribute-model.phtml b/app/views/docs/attribute-model.phtml new file mode 100644 index 00000000..c596dbb6 --- /dev/null +++ b/app/views/docs/attribute-model.phtml @@ -0,0 +1,70 @@ +
| Name | +Type | +Description | +key | +string | +Attribute key. | + + +type | +string | +Attribute type. | + + +status | +string | +Attribute status. Possible values: available, processing, deleting, stuck, or failed |
+
+
+ required | +boolean | +Is attribute required? | + + +array | +boolean | +Is attribute an array? | + +
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.
+ + + + + ++attributeUrl +
++attributeIp +
+ + + \ No newline at end of file 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 00000000..e685405f --- /dev/null +++ b/app/views/docs/email-and-sms-templates.phtml @@ -0,0 +1,251 @@ +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. + Templates also support localization, so every template can be written in multiple languages and served + depending on the configured locale. +
+ ++ 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. +
+ +You can customize email templates for each of your projects in the Appwrite Console.
+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.
+You can customize the email templates for account verification, magic-url authentication, password resets, and user invites.
+Each email templates has the following components that you can customize.
+| Component | +Description | +
| Sender name | +Readers will see this as a display name of the sender. | +
| Sender email | +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 to | +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 | +The title of the email. | +
| Message | +The body of the email in HTML format. You can find the variables available in the Email Template Syntax section. | +
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.
+ +| Variable | +Description | +
{{project}} |
+ The project name. | +
{{team}} |
+ The project team's name. | +
{{user}} |
+ 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}} |
+ The URL for the user to complete the email template's action. | +
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-word; 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>
++ 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 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 an email verification in French.
+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.createVerification('https://example.com');
+
+promise.then(function (response) {
+ console.log(response); // Success
+}, function (error) {
+ console.log(error); // Failure
+});
+ 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.createVerification('https://example.com');
+
+ result
+ .then((response) {
+ print(response);
+ }).catchError((error) {
+ print(error.response);
+ });
+}
+ 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.createVerification('https://example.com')
+ 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.createVerification('https://example.com')
+ dependencies: [
.package(
name: "Appwrite",
- url: "https://github.com/appwrite/sdk-for-swift",
+ url: "https://github.com/appwrite/sdk-for-apple",
.exact("escape($appleVersion); ?>")
)
]')
diff --git a/app/views/docs/index.phtml b/app/views/docs/index.phtml
index 8c3e91ed..0490265d 100644
--- a/app/views/docs/index.phtml
+++ b/app/views/docs/index.phtml
@@ -131,6 +131,7 @@ $cols = [