diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 2ab514f91c..eca5854640 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -205,6 +205,8 @@ class Response extends SwooleResponse public const MODEL_DOMAIN_LIST = 'domainList'; public const MODEL_VARIABLE = 'variable'; public const MODEL_VARIABLE_LIST = 'variableList'; + public const MODEL_TEMPLATE = 'template'; + public const MODEL_EMAIL_TEMPLATE = 'email_template'; // Health public const MODEL_HEALTH_STATUS = 'healthStatus'; diff --git a/src/Appwrite/Utopia/Response/Model/EmailTemplate.php b/src/Appwrite/Utopia/Response/Model/EmailTemplate.php new file mode 100644 index 0000000000..07b7d9c4b7 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/EmailTemplate.php @@ -0,0 +1,59 @@ +addRule('senderName', [ + 'type' => self::TYPE_STRING, + 'description' => 'Name of the sender', + 'default' => '', + 'example' => 'My User', + ]) + ->addRule('senderEmail', [ + 'type' => self::TYPE_STRING, + 'description' => 'Email of the sender', + 'default' => '', + 'example' => 'mail@appwrite.io', + ]) + ->addRule('replyTo', [ + 'type' => self::TYPE_STRING, + 'description' => 'Reply to email address', + 'default' => '', + 'example' => 'emails@appwrite.io', + ]) + ->addRule('subject', [ + 'type' => self::TYPE_STRING, + 'description' => 'Email subject', + 'default' => '', + 'example' => 'Please verify your email address', + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Template'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_TEMPLATE; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Template.php b/src/Appwrite/Utopia/Response/Model/Template.php new file mode 100644 index 0000000000..5650b807ca --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/Template.php @@ -0,0 +1,53 @@ +addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Template type', + 'default' => '', + 'example' => 'verification', + ]) + ->addRule('locale', [ + 'type' => self::TYPE_STRING, + 'description' => 'Template locale', + 'default' => '', + 'example' => 'en_us', + ]) + ->addRule('message', [ + 'type' => self::TYPE_STRING, + 'description' => 'Template message', + 'default' => '', + 'example' => 'Click on the link to verify your account.', + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Template'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_TEMPLATE; + } +}