2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Traits;
|
2017-01-12 20:19:13 +01:00
|
|
|
|
|
|
|
use App\Constants\Domain;
|
2017-01-30 20:40:43 +01:00
|
|
|
use Utils;
|
2017-01-12 20:19:13 +01:00
|
|
|
|
|
|
|
/**
|
2017-01-30 20:40:43 +01:00
|
|
|
* Class SendsEmails.
|
2017-01-12 20:19:13 +01:00
|
|
|
*/
|
|
|
|
trait SendsEmails
|
|
|
|
{
|
|
|
|
public function getBccEmail()
|
|
|
|
{
|
|
|
|
return $this->isPro() ? $this->bcc_email : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFromEmail()
|
|
|
|
{
|
2017-01-30 17:05:31 +01:00
|
|
|
if (! $this->isPro() || ! Utils::isNinja() || Utils::isReseller()) {
|
2017-01-12 20:19:13 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Domain::getEmailFromId($this->domain_id);
|
|
|
|
}
|
|
|
|
}
|