Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit c467e41

Browse files
author
Alex Urucu
committed
Load name to user fields when responding to an email with no user in db
1 parent 586ae2f commit c467e41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/Http/Controllers/ClientsController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ public function editClientByEmail($site, $emailAddress) {
4141
}*/
4242
}
4343

44-
$client = new Client(['listid' => $site->id]);
45-
$client->email = $emailAddress;
4644

4745
$templates = $site->templates()->ofCategory('email')->active()->orderBy('type')->orderBy('name')->get();
4846
$infocosts = $site->infocosts()->active()->default()->get();
4947

5048
$email = Email::fromEmail($emailAddress)->toSite($site)->orderBy('sent_at', 'desc')->first();
5149

50+
$client = new Client(['listid' => $site->id]);
51+
$client->email = $emailAddress;
52+
$client->name = $email->from_name;
53+
5254
if ($email) {
5355
$nextUrl = "/sites/$site->id/nextemailbytime/".$email->sent_at->timestamp;
5456
}

0 commit comments

Comments
 (0)