| 1 |
<?php |
| 2 |
|
| 3 |
namespace WeDevs\ERP\Accounting\Includes\Classes; |
| 4 |
|
| 5 |
use WeDevs\ERP\Email; |
| 6 |
|
| 7 |
class Send_Email extends Email { |
| 8 |
public function __construct() { |
| 9 |
parent::__construct(); |
| 10 |
} |
| 11 |
|
| 12 |
public function trigger( $receiver_emails, $subject = 'Default subject', $body = 'Default body', $attachment = '' ) { |
| 13 |
$results = []; |
| 14 |
|
| 15 |
if ( is_array( $receiver_emails ) ) { |
| 16 |
foreach ( $receiver_emails as $email ) { |
| 17 |
$results[] = $this->send( $email, $subject, $body, '', $attachment ); |
| 18 |
} |
| 19 |
} else { |
| 20 |
$results[] = $this->send( $receiver_emails, $subject, $body, '', $attachment ); |
| 21 |
} |
| 22 |
|
| 23 |
if ( in_array( false, $results, true ) ) { |
| 24 |
return false; |
| 25 |
} |
| 26 |
|
| 27 |
return true; |
| 28 |
} |
| 29 |
} |
| 30 |
|