Skip to content

Commit

Permalink
customer notified mail when admin change the status enhancement done
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhtar Khan committed Feb 19, 2021
1 parent 900fd81 commit ab0f8ce
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
11 changes: 8 additions & 3 deletions src/Http/Controllers/Admin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ public function edit($id)
public function update()
{
$data = request()->except('_token');
$customer = auth()->guard('customer')->user();

$request = $this->gdprDataRequestRepository->where('id',$data['id'])->get();

foreach($request as $value) {
$requestData = $value;
}

$result = $this->gdprDataRequestRepository->find($data['id'])->update($data);

$params = $data + [
'customer_id'=>$customer->id,
'email'=>$customer->email,
'customer_id'=>$requestData->customer_id,
'email'=>$requestData->email,
];

if($result)
Expand Down
13 changes: 7 additions & 6 deletions src/Mail/AdminUpdateDataRequestMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ class AdminUpdateDataRequestMail extends Mailable
{
use Queueable, SerializesModels;

public $dataUpdateRequest;
public $adminUpdateRequest;

public function __construct($adminUpdateRequest) {
$this->adminUpdateRequest = $adminUpdateRequest;

public function __construct($dataUpdateRequest) {
$this->dataUpdateRequest = $dataUpdateRequest;
}

/**
Expand All @@ -24,8 +25,8 @@ public function __construct($dataUpdateRequest) {
*/
public function build()
{
return $this->to($this->dataUpdateRequest['email'])
->subject('New Update of Data Request')
->view('gdpr::emails.customers.new-data-update-request')->with($this->dataUpdateRequest);
return $this->to($this->adminUpdateRequest['email'])
->subject('Request Status')
->view('gdpr::emails.customers.admin-update-data-request')->with($this->adminUpdateRequest);
}
}
1 change: 1 addition & 0 deletions src/Resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
'request-status' => 'Request Status :',
'message' => 'Message',
'thank-you' => 'Thank you',
'status-of-request' => 'Status Of Request',
],
'customer-data-table-heading' => [
'product-name' => 'Product Name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,34 @@
</a>
</div>

<div style="padding: 30px;">
<div style="font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 34px;">
<span style="font-weight: bold;">
{{ __('gdpr::app.mail.new-data-request.heading') }} !
</span> <br>
<div style="font-weight: bold;font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 20px !important;">
{{ __('gdpr::app.mail.new-data-request.summary') }}
</div>
</div>


<div style="flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 20px;">
<div style="line-height: 25px;">
<div>

<div style="font-weight: bold;font-size: 16px;color: #242424">
{{ __('gdpr::app.mail.new-data-request.request-status') }}
</div>

<div>
{{ $adminUpdateDataRequest['request_status'] }}
{{ $adminUpdateRequest['request_status'] }}
</div>
</div>

<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('gdpr::app.mail.new-data-request.request-type') }}
</div>
<div>
{{ $adminUpdateDataRequest['request_type'] }}
</div>
<div>

<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('gdpr::app.mail.new-data-request.message') }}
</div>

<div style="font-size: 16px; color: #242424;">
{{ $adminUpdateDataRequest['message'] }}
{{ $adminUpdateRequest['message'] }}
</div>

</div>
Expand Down

0 comments on commit ab0f8ce

Please sign in to comment.