mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Implementado servicio de envio de emails y funcion de envio a correo unico en etorno de desarrollo
This commit is contained in:
@ -40,7 +40,7 @@ class ChatService extends BaseService
|
||||
protected array $modelClassMap;
|
||||
public function __construct()
|
||||
{
|
||||
$this->emailService = service('email');
|
||||
$this->emailService = service('emailService'); // Usar el servicio de email de Safekat y no el de CI4
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->chatModel = model(ChatModel::class);
|
||||
$this->chatMessageModel = model(ChatMessageModel::class);
|
||||
@ -186,10 +186,15 @@ class ChatService extends BaseService
|
||||
{
|
||||
$users = auth()->getProvider();
|
||||
$toEmail = $users->find($user->id)->getEmail();
|
||||
$this->emailService->setTo($toEmail);
|
||||
$subject = '[Safekat]' . lang('Chat.mail.mail_subject') . '-' . $chatMessageEntity->chat()->title;
|
||||
$this->emailService->setSubject($subject);
|
||||
$this->emailService->setMessage(view('themes/vuexy/mail/messageNotification', ["header" => lang('Chat.mail.mail_subject'), "data" => $chatMessageEntity->withUser()]));
|
||||
return $this->emailService->send();
|
||||
|
||||
$subject = '[Safekat]' . lang('Chat.mail.mail_subject') . ' - ' . $chatMessageEntity->chat()->title;
|
||||
|
||||
$message = view('themes/vuexy/mail/messageNotification', [
|
||||
"header" => lang('Chat.mail.mail_subject'),
|
||||
"data" => $chatMessageEntity->withUser(),
|
||||
]);
|
||||
|
||||
return $this->emailService->send($subject, $message, $toEmail);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user