Recurring component development sent automatically send email feature..

This commit is contained in:
Cüneyt Şentürk
2023-03-22 14:18:12 +03:00
parent 31c5891025
commit 96f2b4de9d
5 changed files with 91 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ trait Recurring
$limit_by = !empty($request['recurring_limit']) ? $request['recurring_limit'] : 'count';
$limit_count = isset($request['recurring_limit_count']) ? (int) $request['recurring_limit_count'] : 0;
$limit_date = !empty($request['recurring_limit_date']) ? $request['recurring_limit_date'] : null;
$auto_send = !empty($request['recurring_send_email']) ? $request['recurring_send_email'] : 0;
$source = !empty($request['created_from']) ? $request['created_from'] : source_name();
$owner = !empty($request['created_by']) ? $request['created_by'] : user_id();
@@ -35,6 +36,7 @@ trait Recurring
'limit_by' => $limit_by,
'limit_count' => $limit_count,
'limit_date' => $limit_date,
'auto_send' => $auto_send,
'created_from' => $source,
'created_by' => $owner,
]);
@@ -54,6 +56,7 @@ trait Recurring
$limit_by = !empty($request['recurring_limit']) ? $request['recurring_limit'] : 'count';
$limit_count = isset($request['recurring_limit_count']) ? (int) $request['recurring_limit_count'] : 0;
$limit_date = !empty($request['recurring_limit_date']) ? $request['recurring_limit_date'] : null;
$auto_send = !empty($request['recurring_send_email']) ? $request['recurring_send_email'] : 0;
$recurring = $this->recurring();
$model_exists = $recurring->count();
@@ -66,6 +69,7 @@ trait Recurring
'limit_by' => $limit_by,
'limit_count' => $limit_count,
'limit_date' => $limit_date,
'auto_send' => $auto_send,
];
if (! empty($request['recurring_status'])) {

View File

@@ -22,6 +22,9 @@ class Recurring extends Component
public $limitCount = '';
public $limitDateValue = '';
public $sendEmailShow;
public $sendEmail;
/**
* Create a new component instance.
*
@@ -41,6 +44,9 @@ class Recurring extends Component
$startedValue = '',
$limitCount = '',
$limitDateValue = '',
$sendEmailShow = true,
$sendEmail = false
) {
$this->type = $this->getType($type);
$this->frequency = $this->getFrequency($frequency);
@@ -55,6 +61,9 @@ class Recurring extends Component
$this->startedValue = $this->getStartedValue($startedValue);
$this->limitCount = $this->getLimitCount($limitCount);
$this->limitDateValue = $this->getLimitDateValue($limitDateValue);
$this->sendEmailShow = $this->getSendEmailShow($sendEmailShow);
$this->sendEmail = $this->getSendEmail($sendEmail);
}
/**
@@ -171,4 +180,22 @@ class Recurring extends Component
return Date::now()->toDateString();
}
protected function getSendEmailShow($sendEmailShow)
{
if (! empty($sendEmailShow)) {
return $sendEmailShow;
}
return false;
}
protected function getSendEmail($sendEmail)
{
if (! empty($sendEmail)) {
return $sendEmail;
}
return false;
}
}