1
0
Fork 0
mirror of synced 2024-08-04 13:01:45 +12:00

response models

This commit is contained in:
Damodar Lohani 2023-03-10 06:27:30 +00:00
parent 1cd0498b15
commit 83891f96eb
3 changed files with 114 additions and 0 deletions

View file

@ -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';

View file

@ -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;
}
}

View file

@ -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;
}
}