mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 12:37:32 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			453 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			453 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace App\Models\Traits;
 | |
| 
 | |
| use Utils;
 | |
| use App\Constants\Domain;
 | |
| 
 | |
| /**
 | |
|  * Class SendsEmails
 | |
|  */
 | |
| trait SendsEmails
 | |
| {
 | |
|     public function getBccEmail()
 | |
|     {
 | |
|         return $this->isPro() ? $this->bcc_email : false;
 | |
|     }
 | |
| 
 | |
|     public function getFromEmail()
 | |
|     {
 | |
|         if ( ! $this->isPro() || ! Utils::isNinjaProd() || Utils::isReseller()) {
 | |
|             return false;
 | |
|         }
 | |
| 
 | |
|         return Domain::getEmailFromId($this->domain_id);
 | |
|     }
 | |
| }
 |