Subscribe and unsubscribe subscribers via commands
This commit is contained in:
committed by
James Brooks
parent
11b4ab5c6c
commit
8250e4ebca
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Commands\Subscriber;
|
||||
|
||||
class SubscribeSubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The subscriber auto verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $verified;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $rules = [
|
||||
'email' => 'required|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new subscribe subscriber command instance.
|
||||
*
|
||||
* @param string $email
|
||||
* @param bool $verified
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($email, $verified = false)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->verified = $verified;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Commands\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class UnsubscribeSubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The subscriber to unsubscribe.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a unsubscribe subscriber command instance.
|
||||
*
|
||||
* @param string $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
+9
-7
@@ -11,24 +11,26 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Commands\Subscriber;
|
||||
|
||||
class SubscribeCustomerCommand
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
|
||||
class VerifySubscriberCommand
|
||||
{
|
||||
/**
|
||||
* The customer email.
|
||||
* The subscriber to verify.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
public $subscriber;
|
||||
|
||||
/**
|
||||
* Create a new subscribe customer command instance.
|
||||
* Create a verify subscriber command instance.
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $subscriber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($email)
|
||||
public function __construct(Subscriber $subscriber)
|
||||
{
|
||||
$this->email = $email;
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user