Skip to content

Commit 0a7d124

Browse files
committed
Quote user firstname in default email subject
1 parent 943fac3 commit 0a7d124

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

ProcessMaker/Http/Controllers/Process/ModelerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private function getDefaultEmailNotification(): array
170170
$screen = Screen::getScreenByKey('default-email-task-notification');
171171

172172
return [
173-
'subject' => 'RE: {{_user.firstname}} assigned you in "{{_task_name}}"',
173+
'subject' => 'RE: "{{_user.firstname}}" assigned you in "{{_task_name}}"',
174174
'type' => 'screen',
175175
'screenRef' => $screen->id,
176176
'toRecipients' => [

tests/Feature/Processes/ModelerTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,23 @@ public function testInflightRouteWithViewPermission()
5959
$response = $this->actingAs($user)->get($anotherRoute);
6060
$response->assertStatus(200);
6161
}
62+
63+
public function testModelerShowExposesDefaultEmailNotificationWithQuotedUserFirstName()
64+
{
65+
$user = User::factory()->admin()->create();
66+
$process = Process::factory()->create();
67+
68+
$route = route('modeler.show', ['process' => $process->id]);
69+
$response = $this->actingAs($user)->get($route);
70+
71+
$response->assertStatus(200);
72+
$response->assertViewHas('defaultEmailNotification');
73+
74+
$defaultEmailNotification = $response->viewData('defaultEmailNotification');
75+
76+
$this->assertSame(
77+
'RE: "{{_user.firstname}}" assigned you in "{{_task_name}}"',
78+
$defaultEmailNotification['subject']
79+
);
80+
}
6281
}

0 commit comments

Comments
 (0)