diff --git a/ProcessMaker/Http/Controllers/Process/ModelerController.php b/ProcessMaker/Http/Controllers/Process/ModelerController.php index d6ef304343..e45d183445 100644 --- a/ProcessMaker/Http/Controllers/Process/ModelerController.php +++ b/ProcessMaker/Http/Controllers/Process/ModelerController.php @@ -170,7 +170,7 @@ private function getDefaultEmailNotification(): array $screen = Screen::getScreenByKey('default-email-task-notification'); return [ - 'subject' => 'RE: {{_user.firstname}} assigned you in "{{_task_name}}"', + 'subject' => 'RE: "{{_user.firstname}}" assigned you in "{{_task_name}}"', 'type' => 'screen', 'screenRef' => $screen->id, 'toRecipients' => [ diff --git a/tests/Feature/Processes/ModelerTest.php b/tests/Feature/Processes/ModelerTest.php index 2e0d423b15..df209edb52 100644 --- a/tests/Feature/Processes/ModelerTest.php +++ b/tests/Feature/Processes/ModelerTest.php @@ -59,4 +59,23 @@ public function testInflightRouteWithViewPermission() $response = $this->actingAs($user)->get($anotherRoute); $response->assertStatus(200); } + + public function testModelerShowExposesDefaultEmailNotificationWithQuotedUserFirstName() + { + $user = User::factory()->admin()->create(); + $process = Process::factory()->create(); + + $route = route('modeler.show', ['process' => $process->id]); + $response = $this->actingAs($user)->get($route); + + $response->assertStatus(200); + $response->assertViewHas('defaultEmailNotification'); + + $defaultEmailNotification = $response->viewData('defaultEmailNotification'); + + $this->assertSame( + 'RE: "{{_user.firstname}}" assigned you in "{{_task_name}}"', + $defaultEmailNotification['subject'] + ); + } }