forked from miguel456/rbrecruiter
Revert "Apply fixes from StyleCI (pull request #6)"
This reverts pull request #6. > This pull request applies code style fixes from an analysis carried out by [StyleCI](https://bitbucket.styleci.io). > > For more information, click [here](https://bitbucket.styleci.io/analyses/a2Jl7D).
This commit is contained in:
@@ -1,27 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Application;
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -29,6 +9,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use App\Application;
|
||||
|
||||
class ApplicationApproved extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -64,9 +45,10 @@ class ApplicationApproved extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - '.$this->application->response->vacancy->vacancyName.' application approved')
|
||||
->subject(config('app.name') . ' - ' . $this->application->response->vacancy->vacancyName . ' application approved')
|
||||
->line('<br />')
|
||||
->line('Congratulations! Our Staff team has reviewed your application today, and your application has been approved.')
|
||||
->line('You have just received the Reviewer role, which allows you to view and vote on other applications.')
|
||||
@@ -80,18 +62,19 @@ class ApplicationApproved extends Notification implements ShouldQueue
|
||||
|
||||
public function toSlack($notifiable)
|
||||
{
|
||||
|
||||
$url = route('showSingleProfile', ['user' => $notifiable->id]);
|
||||
$roles = implode(', ', $notifiable->roles->pluck('name')->all());
|
||||
|
||||
return (new SlackMessage)
|
||||
->success()
|
||||
->content('A user has been approved on the team. Welcome aboard!')
|
||||
->attachment(function ($attachment) use ($notifiable, $url, $roles) {
|
||||
->attachment(function($attachment) use ($notifiable, $url, $roles){
|
||||
$attachment->title('New staff member')
|
||||
->fields([
|
||||
'Name' => $notifiable->name,
|
||||
'Email' => $notifiable->email,
|
||||
'Roles' => $roles,
|
||||
'Roles' => $roles
|
||||
])
|
||||
->action('View profile', $url);
|
||||
});
|
||||
|
@@ -1,37 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Application;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use App\Application;
|
||||
|
||||
class ApplicationDenied extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
|
||||
public $application;
|
||||
|
||||
/**
|
||||
@@ -63,9 +45,10 @@ class ApplicationDenied extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - '.$this->application->response->vacancy->vacancyName.' application denied')
|
||||
->subject(config('app.name') . ' - ' . $this->application->response->vacancy->vacancyName . ' application denied')
|
||||
->line('Your most recent application has been denied.')
|
||||
->line('Our review team denies applications for several reasons, including poor answers.')
|
||||
->line('Please review your application and try again in 30 days.')
|
||||
@@ -73,19 +56,20 @@ class ApplicationDenied extends Notification implements ShouldQueue
|
||||
->line('Better luck next time!');
|
||||
}
|
||||
|
||||
|
||||
public function toSlack($notifiable)
|
||||
{
|
||||
$notifiableName = $notifiable->name;
|
||||
$notifiableName = $notifiable->name;
|
||||
|
||||
return (new SlackMessage)
|
||||
return (new SlackMessage)
|
||||
->error()
|
||||
->content('An application has just been denied.')
|
||||
->attachment(function ($attachment) use ($notifiableName) {
|
||||
->attachment(function($attachment) use ($notifiableName){
|
||||
$attachment->title('Application denied!')
|
||||
->content($notifiableName.'\'s application has just been denied. They can try again in 30 days.');
|
||||
->content($notifiableName . '\'s application has just been denied. They can try again in 30 days.');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
|
@@ -1,32 +1,13 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use App\Traits\Cancellable;
|
||||
use App\Facades\Options;
|
||||
|
||||
class ApplicationMoved extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -57,7 +38,7 @@ class ApplicationMoved extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Application Updated')
|
||||
->subject(config('app.name') . ' - Application Updated')
|
||||
->line('Your most recent application has been moved up a stage.')
|
||||
->line('This means our team has reviewed it and an interview will be scheduled ASAP.')
|
||||
->action('Sign in', url(route('login')))
|
||||
|
@@ -1,24 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -61,7 +42,7 @@ class AppointmentFinished extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Appointment completed')
|
||||
->subject(config('app.name') . ' - Appointment completed')
|
||||
->line('Your appointment has been marked as completed!')
|
||||
->line('Please allow an additional day for your application to be fully processed.')
|
||||
->action('View applications', url(route('showUserApps')))
|
||||
|
@@ -1,36 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Appointment;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
use App\Appointment;
|
||||
|
||||
class AppointmentScheduled extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
|
||||
protected $appointment;
|
||||
|
||||
/**
|
||||
@@ -64,10 +47,10 @@ class AppointmentScheduled extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Interview scheduled')
|
||||
->line('A voice interview has been scheduled for you @ '.$this->appointment->appointmentDate.'.')
|
||||
->line('With the following details: '.$this->appointment->appointmentDescription)
|
||||
->line('This meeting will take place @ '.$this->appointment->appointmentLocation.'. You will receive an email soon with details on how to join this meeting.')
|
||||
->subject(config('app.name') . ' - Interview scheduled')
|
||||
->line('A voice interview has been scheduled for you @ ' . $this->appointment->appointmentDate . '.')
|
||||
->line('With the following details: ' . $this->appointment->appointmentDescription)
|
||||
->line('This meeting will take place @ ' . $this->appointment->appointmentLocation . '. You will receive an email soon with details on how to join this meeting.')
|
||||
->line('You are expected to show up at least 5 minutes before the scheduled date.')
|
||||
->action('Sign in', url(route('login')))
|
||||
->line('Thank you!');
|
||||
|
@@ -1,24 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -61,7 +42,7 @@ class ChangedPassword extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Account password changed')
|
||||
->subject(config('app.name') . ' - Account password changed')
|
||||
->line('The password for the account registered to this email address has just been changed.')
|
||||
->line('If this was not you, please contact an administrator immediately.')
|
||||
->action('Sign in', url(route('login')))
|
||||
|
@@ -1,24 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -61,7 +42,7 @@ class EmailChanged extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Email address changed')
|
||||
->subject(config('app.name') . ' - Email address changed')
|
||||
->line('The email address for your account has just been updated, either by you or an administrator.')
|
||||
->action('Sign in', url(route('login')))
|
||||
->line('Thank you!');
|
||||
|
@@ -1,42 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Application;
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
use App\Vacancy;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use App\Application;
|
||||
use App\Vacancy;
|
||||
|
||||
use App\Traits\Cancellable;
|
||||
use App\Facades\Options;
|
||||
|
||||
class NewApplicant extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable, Cancellable;
|
||||
|
||||
|
||||
protected $application;
|
||||
|
||||
|
||||
protected $vacancy;
|
||||
|
||||
/**
|
||||
@@ -52,7 +36,8 @@ class NewApplicant extends Notification implements ShouldQueue
|
||||
|
||||
public function channels()
|
||||
{
|
||||
if (Options::getOption('enable_slack_notifications') == 1) {
|
||||
if (Options::getOption('enable_slack_notifications') == 1)
|
||||
{
|
||||
return ['slack'];
|
||||
}
|
||||
|
||||
@@ -74,15 +59,17 @@ class NewApplicant extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - New application')
|
||||
->subject(config('app.name') . ' - New application')
|
||||
->line('Someone has just applied for a position. Check it out!')
|
||||
->line('You are receiving this because you\'re a staff member at '.config('app.name').'.')
|
||||
->line('You are receiving this because you\'re a staff member at ' . config('app.name') . '.')
|
||||
->action('View Application', url(route('showUserApp', ['application' => $this->application->id])))
|
||||
->line('Thank you!');
|
||||
}
|
||||
|
||||
|
||||
public function toSlack($notifiable)
|
||||
{
|
||||
|
||||
$vacancyDetails = [];
|
||||
$vacancyDetails['name'] = $this->vacancy->vacancyName;
|
||||
$vacancyDetails['slots'] = $this->vacancy->vacancyCount;
|
||||
@@ -93,17 +80,16 @@ class NewApplicant extends Notification implements ShouldQueue
|
||||
return (new SlackMessage)
|
||||
->success()
|
||||
->content('Notice: New application coming through. Please review as soon as possible.')
|
||||
->attachment(function ($attachment) use ($vacancyDetails, $url, $applicant) {
|
||||
->attachment(function($attachment) use ($vacancyDetails, $url, $applicant){
|
||||
$attachment->title('Application details')
|
||||
->fields([
|
||||
'Applied for' => $vacancyDetails['name'],
|
||||
'Avaiable positions' => $vacancyDetails['slots'],
|
||||
'Applicant' => $applicant,
|
||||
'Applied for' => $vacancyDetails['name'],
|
||||
'Avaiable positions' => $vacancyDetails['slots'],
|
||||
'Applicant' => $applicant
|
||||
])
|
||||
->action('Review application', $url);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
|
@@ -1,39 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Application;
|
||||
use App\Comment;
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use App\Comment;
|
||||
use App\Application;
|
||||
use App\Traits\Cancellable;
|
||||
use App\Facades\Options;
|
||||
|
||||
class NewComment extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable, Cancellable;
|
||||
|
||||
|
||||
protected $application;
|
||||
|
||||
/**
|
||||
@@ -61,7 +43,7 @@ class NewComment extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - New comment')
|
||||
->subject(config('app.name') . ' - New comment')
|
||||
->line('Someone has just posted a new comment on an application you follow.')
|
||||
->line('You\'re receiving this email because you\'ve voted/commented on this application.')
|
||||
->action('Check it out', url(route('showUserApp', ['application' => $this->application->id])))
|
||||
|
@@ -1,27 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -62,22 +44,23 @@ class NewContact extends Notification
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
if ($this->message->has([
|
||||
'message',
|
||||
'ip',
|
||||
'email',
|
||||
])) {
|
||||
return (new MailMessage)
|
||||
'message',
|
||||
'ip',
|
||||
'email'
|
||||
]))
|
||||
{
|
||||
return (new MailMessage)
|
||||
->line('We\'ve received a new contact form submission in the StaffManagement app center.')
|
||||
->line('This is what they sent: ')
|
||||
->line('')
|
||||
->line($this->message->get('message'))
|
||||
->line('')
|
||||
->line('This message was received from '.$this->message->get('ip').' and submitted by '.$this->message->get('email').'.')
|
||||
->line('This message was received from ' . $this->message->get('ip') . ' and submitted by ' . $this->message->get('email') . '.')
|
||||
->action('Sign in', url(route('login')))
|
||||
->line('Thank you!');
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('Invalid arguments supplied to NewContact!');
|
||||
throw new \InvalidArgumentException("Invalid arguments supplied to NewContact!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,35 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Facades\Options;
|
||||
use App\Facades\UUID;
|
||||
use App\Traits\Cancellable;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
|
||||
use App\User;
|
||||
use App\Facades\UUID;
|
||||
use App\Traits\Cancellable;
|
||||
use App\Facades\Options;
|
||||
|
||||
class NewUser extends Notification implements ShouldQueue
|
||||
{
|
||||
@@ -67,8 +49,8 @@ class NewUser extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - New user')
|
||||
->line($this->user->name.' has just registered to our site.')
|
||||
->subject(config('app.name') . ' - New user')
|
||||
->line($this->user->name . ' has just registered to our site.')
|
||||
->line('You are receiving this email because you opted to receive new user notifications.')
|
||||
->action('View profile', url(route('showSingleProfile', ['user' => $this->user->id])))
|
||||
->line('Thank you!');
|
||||
@@ -76,26 +58,28 @@ class NewUser extends Notification implements ShouldQueue
|
||||
|
||||
public function toSlack($notifiable)
|
||||
{
|
||||
$user = [];
|
||||
$user = [];
|
||||
|
||||
$user['name'] = $this->user->name;
|
||||
$user['email'] = $this->user->email;
|
||||
$user['username'] = UUID::toUsername($this->user->uuid);
|
||||
$user['name'] = $this->user->name;
|
||||
$user['email'] = $this->user->email;
|
||||
$user['username'] = UUID::toUsername($this->user->uuid);
|
||||
|
||||
$date = \Carbon\Carbon::parse($this->user->created_at);
|
||||
$user['created_at'] = $date->englishMonth.' '.$date->day.' '.$date->year;
|
||||
$date = \Carbon\Carbon::parse($this->user->created_at);
|
||||
$user['created_at'] = $date->englishMonth . ' ' . $date->day . ' ' . $date->year;
|
||||
|
||||
return (new SlackMessage)
|
||||
->success()
|
||||
->content('A new user has signed up!')
|
||||
->attachment(function ($attachment) use ($user) {
|
||||
->attachment(function($attachment) use ($user){
|
||||
|
||||
$attachment->title('User details')
|
||||
->fields([
|
||||
'Email address' => $user['email'],
|
||||
'Name' => $user['name'],
|
||||
'Minecraft Username' => $user['username'],
|
||||
'Registration date' => $user['created_at'],
|
||||
'Email address' => $user['email'],
|
||||
'Name' => $user['name'],
|
||||
'Minecraft Username' => $user['username'],
|
||||
'Registration date' => $user['created_at']
|
||||
]);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,33 +1,15 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Ban;
|
||||
use App\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
use App\User;
|
||||
use App\Ban;
|
||||
|
||||
class UserBanned extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
@@ -35,7 +17,6 @@ class UserBanned extends Notification implements ShouldQueue
|
||||
protected $user;
|
||||
|
||||
protected $ban;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*
|
||||
@@ -69,8 +50,8 @@ class UserBanned extends Notification implements ShouldQueue
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->line('Hello, ')
|
||||
->line('Moderators have just banned user '.$this->user->name.' for '.$this->ban->reason)
|
||||
->line('This ban will remain in effect until '.$this->ban->bannedUntil.'.')
|
||||
->line('Moderators have just banned user ' . $this->user->name . ' for ' . $this->ban->reason)
|
||||
->line('This ban will remain in effect until ' . $this->ban->bannedUntil . '.')
|
||||
->action('View profile', url(route('showSingleProfile', ['user' => $this->user->id])))
|
||||
->line('Thank you!');
|
||||
}
|
||||
|
@@ -1,35 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
use App\Vacancy;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
use App\Vacancy;
|
||||
use App\Facades\Options;
|
||||
use App\Traits\Cancellable;
|
||||
|
||||
class VacancyClosed extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable, SerializesModels, Cancellable;
|
||||
@@ -43,7 +25,7 @@ class VacancyClosed extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function __construct(Vacancy $vacancy)
|
||||
{
|
||||
$this->vacancy = $vacancy;
|
||||
$this->vacancy = $vacancy;
|
||||
}
|
||||
|
||||
public function optOut($notifiable)
|
||||
@@ -61,8 +43,8 @@ class VacancyClosed extends Notification implements ShouldQueue
|
||||
{
|
||||
return (new MailMessage)
|
||||
->from(config('notification.sender.address'), config('notification.sender.name'))
|
||||
->subject(config('app.name').' - Vacancy Closed')
|
||||
->line('The vacancy '.$this->vacancy->vacancyName.', with '.$this->vacancy->vacancyCount.' remaining slots, has just been closed.')
|
||||
->subject(config('app.name') . ' - Vacancy Closed')
|
||||
->line('The vacancy ' . $this->vacancy->vacancyName . ', with ' . $this->vacancy->vacancyCount . ' remaining slots, has just been closed.')
|
||||
->line('Please be aware that this position may be deleted/reopened any time.')
|
||||
->action('View positions', url(route('showPositions')))
|
||||
->line('Thank you!');
|
||||
|
Reference in New Issue
Block a user