codigo actual del servidor, con avances de joan
This commit is contained in:
82
app/Notifications/EmailVerificationNotification.php
Normal file
82
app/Notifications/EmailVerificationNotification.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use App\Mail\EmailManager;
|
||||
use Auth;
|
||||
use App\Models\User;
|
||||
|
||||
class EmailVerificationNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public $verificationCode;
|
||||
|
||||
public function __construct($verificationCode)
|
||||
{
|
||||
$this->verificationCode = $verificationCode;
|
||||
}
|
||||
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
$verificationCode = $this->verificationCode;
|
||||
|
||||
return (new MailMessage)
|
||||
->subject(translate('Email Verification - ') . env('APP_NAME'))
|
||||
->line('Your verification code is: ' . $verificationCode); // Mostrar el código de verificación en el correo
|
||||
}
|
||||
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* class EmailVerificationNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
$notifiable->verification_code = encrypt($notifiable->id);
|
||||
$notifiable->save();
|
||||
|
||||
$array['view'] = 'emails.verification';
|
||||
$array['subject'] = translate('Email Verification');
|
||||
$array['content'] = translate('Please click the button below to verify your email address.');
|
||||
$array['link'] = route('email.verification.confirmation', $notifiable->verification_code);
|
||||
|
||||
return (new MailMessage)
|
||||
->view('emails.verification', ['array' => $array])
|
||||
->subject(translate('Email Verification - ').env('APP_NAME'));
|
||||
}
|
||||
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
} */
|
||||
Reference in New Issue
Block a user