芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/kwesioben.com/paymoney/app/Services/Mail/SendMoney/EmailToReceiverMailService.php
* @contributor Ahammed Imtiaze <[imtiaze.techvill@gmail.com]> * @created 29-05-2023 */ namespace App\Services\Mail\SendMoney; use Exception; use App\Services\Mail\TechVillageMail; class EmailToReceiverMailService extends TechVillageMail { /** * The array of status and message whether email sent or not. * * @var array */ protected $mailResponse = []; public function __construct() { parent::__construct(); $this->mailResponse = [ 'status' => true, 'message' => __('We have sent you the ticket status. Please check your email.') ]; } /** * Send forgot password code to user email * @param object $user * @return array $response */ public function send($transfer, $optional = []) { try { $response = $this->getEmailTemplate('notify-money-receiver'); if (!$response['status']) { return $response; } if (is_null($transfer->receiver_id)) { $subject = __('Money Received Notification'); $message = __('Hi
:x
,', ['x' => explode("@", trim($transfer->email))[0]]) . '
'; $message .= __('You have got
:x
money transfer from
:y
.', ['x' => moneyFormat(optional($transfer->currency)->symbol, formatNumber($transfer->amount)), 'y' => optional($transfer->sender)->email]) . '
'; $message .= __('To receive the money, please register at
:x
with this email
:y
.', ['x' => '
'.url('/register').'
', 'y' => '
'.$transfer->email.'
']) . '
'; $message .= __('
Note:
:x.
', ['x' => $transfer->note]); $message .= __('Regards') . ',
'; $message .= '
'.settings('name').'
'; } else { $data = [ "{receiver_id}" => is_null($transfer->receiver_id) ? $transfer->email : getColumnValue($transfer->receiver), "{amount}" => moneyFormat(optional($transfer->currency)->symbol, formatNumber($transfer->amount, $transfer->currency_id)), "{sender_id}" => getColumnValue($transfer->sender), "{uuid}" => $transfer->uuid, "{created_at}" => dateFormat($transfer->created_at), "{note}" => $transfer->note, "{soft_name}" => settings('name') ]; $message = str_replace(array_keys($data), $data, $response['template']->body); $subject = $response['template']->subject; } $this->email->sendEmail($transfer->email, $subject, $message); } catch (Exception $e) { $this->mailResponse = ['status' => false, 'message' => $e->getMessage()]; } return $this->mailResponse; } }