2024-10-31 11:40:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Notifications\Netmails\Areafix;
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
use App\Notifications\Netmails;
|
|
|
|
use App\Models\Netmail;
|
|
|
|
use App\Traits\{MessagePath,PageTemplate};
|
|
|
|
|
|
|
|
class InvalidPassword extends Netmails
|
|
|
|
{
|
|
|
|
use MessagePath,PageTemplate;
|
|
|
|
|
|
|
|
private const LOGKEY = 'AIP';
|
|
|
|
|
|
|
|
private Netmail $mo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reply to a areafix, but the password is incorrect.
|
|
|
|
*
|
|
|
|
* @param Netmail $mo
|
|
|
|
*/
|
|
|
|
public function __construct(Netmail $mo)
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->mo = $mo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the mail representation of the notification.
|
|
|
|
*
|
|
|
|
* @param mixed $notifiable
|
|
|
|
* @return Netmail
|
|
|
|
* @throws \Exception
|
|
|
|
*/
|
|
|
|
public function toNetmail(object $notifiable): Netmail
|
|
|
|
{
|
|
|
|
$o = $this->setupNetmail($notifiable);
|
|
|
|
$ao = $notifiable->routeNotificationFor(static::via);
|
|
|
|
|
2024-10-31 23:28:22 +00:00
|
|
|
Log::info(sprintf('%s:+ Responding to areafix for a node [%s] INVALID PASSWORD',self::LOGKEY,$ao->ftn));
|
2024-10-31 11:40:58 +00:00
|
|
|
|
|
|
|
$o->to = $this->mo->from;
|
|
|
|
$o->replyid = $this->mo->msgid;
|
2024-11-01 01:35:36 +00:00
|
|
|
$o->subject = '*fix - Invalid Password';
|
2024-10-31 11:40:58 +00:00
|
|
|
|
|
|
|
// Message
|
2024-11-01 01:35:36 +00:00
|
|
|
$msg = $this->page(FALSE,$this->mo->to);
|
2024-10-31 11:40:58 +00:00
|
|
|
|
|
|
|
$msg->addText("Your areafix request has been received, but unfortunately your password was incorrect.\r\r");
|
|
|
|
$msg->addText(sprintf("If you are not aware of your password, head over to %s. Feel free to netmail if you need help.\r\r",config('app.url')));
|
|
|
|
|
|
|
|
$msg->addText($this->message_path($this->mo));
|
|
|
|
|
|
|
|
$o->msg = $msg->render();
|
|
|
|
$o->set_tagline = 'Why did the robot cross the road? The chicken programmed it.';
|
|
|
|
|
|
|
|
$o->save();
|
|
|
|
|
|
|
|
return $o;
|
|
|
|
}
|
|
|
|
}
|