Make email setup changes

This commit is contained in:
Matthew Shillam 2018-11-01 16:51:14 +00:00
parent f7d3d225e4
commit 9d9589f9a0
7 changed files with 13 additions and 7 deletions

View File

@ -80,17 +80,17 @@ class BackupController extends Controller
*/ */
if($backup->status == "Success") if($backup->status == "Success")
{ {
Mail::to($client->email) Mail::to('reports@mydentalbackup.co.uk')
->send(new BackupSuccess($backup, $client)); ->send(new BackupSuccess($backup, $client));
} }
elseif($backup->status == "Warning") elseif($backup->status == "Warning")
{ {
Mail::to($client->email) Mail::to('reports@mydentalbackup.co.uk')
->send(new BackupWarning($backup, $client)); ->send(new BackupWarning($backup, $client));
} }
elseif($backup->status == "Error") elseif($backup->status == "Error")
{ {
Mail::to($client->email) Mail::to('reports@mydentalbackup.co.uk')
->send(new BackupError($backup, $client)); ->send(new BackupError($backup, $client));
} }
else{ else{

View File

@ -31,7 +31,7 @@ class BackupError extends Mailable
public function build() public function build()
{ {
return $this->from('reports@mydentalbackup.co.uk') return $this->from('reports@mydentalbackup.co.uk')
->cc('reports@mydentalbackup.co.uk') ->cc($this->client->email ?: [])
->subject('Backup ( ' . $this->backup->schedule_name . ' ) Error! for : ' . $this->client->client_name) ->subject('Backup ( ' . $this->backup->schedule_name . ' ) Error! for : ' . $this->client->client_name)
->markdown('mail.backup.error', ['backup' => $this->backup]); ->markdown('mail.backup.error', ['backup' => $this->backup]);
} }

View File

@ -29,9 +29,9 @@ class BackupSuccess extends Mailable
* @return $this * @return $this
*/ */
public function build() public function build()
{ {
return $this->from('reports@mydentalbackup.co.uk') return $this->from('reports@mydentalbackup.co.uk')
->cc('reports@mydentalbackup.co.uk') ->cc($this->client->email ?: [])
->subject('Backup ( ' . $this->backup->schedule_name . ' ) Success! for : ' . $this->client->client_name . '') ->subject('Backup ( ' . $this->backup->schedule_name . ' ) Success! for : ' . $this->client->client_name . '')
->markdown('mail.backup.success', ['backup' => $this->backup]); ->markdown('mail.backup.success', ['backup' => $this->backup]);
} }

View File

@ -31,7 +31,7 @@ class BackupWarning extends Mailable
public function build() public function build()
{ {
return $this->from('reports@mydentalbackup.co.uk') return $this->from('reports@mydentalbackup.co.uk')
->cc('reports@mydentalbackup.co.uk') ->cc($this->client->email ?: [])
->subject('Backup ( ' . $this->backup->schedule_name . ' ) Warning! for : ' . $this->client->client_name . '') ->subject('Backup ( ' . $this->backup->schedule_name . ' ) Warning! for : ' . $this->client->client_name . '')
->markdown('mail.backup.warning', ['backup' => $this->backup]); ->markdown('mail.backup.warning', ['backup' => $this->backup]);
} }

View File

@ -13,6 +13,8 @@ Contact us.
| :------------ | --------:| | :------------ | --------:|
| Number of added files | {{$backup->added_files}} | | Number of added files | {{$backup->added_files}} |
| Size of added files | {{$backup->size_of_added_files}} | | Size of added files | {{$backup->size_of_added_files}} |
| Number of modified files | {{$backup->modified_files}} |
| Size of modified files | {{$backup->size_of_modified_files}} |
| Backup started | {{$backup->started_at}} | | Backup started | {{$backup->started_at}} |
| Backup finished | {{$backup->finished_at}} | | Backup finished | {{$backup->finished_at}} |
| Total backup time | {{$backup->duration}} | | Total backup time | {{$backup->duration}} |

View File

@ -13,6 +13,8 @@ Contact us.
| :------------ | --------:| | :------------ | --------:|
| Number of added files | {{$backup->added_files}} | | Number of added files | {{$backup->added_files}} |
| Size of added files | {{$backup->size_of_added_files}} | | Size of added files | {{$backup->size_of_added_files}} |
| Number of modified files | {{$backup->modified_files}} |
| Size of modified files | {{$backup->size_of_modified_files}} |
| Backup started | {{$backup->started_at}} | | Backup started | {{$backup->started_at}} |
| Backup finished | {{$backup->finished_at}} | | Backup finished | {{$backup->finished_at}} |
| Total backup time | {{$backup->duration}} | | Total backup time | {{$backup->duration}} |

View File

@ -13,6 +13,8 @@ Contact us.
| :------------ | --------:| | :------------ | --------:|
| Number of added files | {{$backup->added_files}} | | Number of added files | {{$backup->added_files}} |
| Size of added files | {{$backup->size_of_added_files}} | | Size of added files | {{$backup->size_of_added_files}} |
| Number of modified files | {{$backup->modified_files}} |
| Size of modified files | {{$backup->size_of_modified_files}} |
| Backup started | {{$backup->started_at}} | | Backup started | {{$backup->started_at}} |
| Backup finished | {{$backup->finished_at}} | | Backup finished | {{$backup->finished_at}} |
| Total backup time | {{$backup->duration}} | | Total backup time | {{$backup->duration}} |