mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
response models
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class EmailTemplate extends Template
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class Template extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user