From ae963d43c2fcbf90f97879efb645962ee1e9cc58 Mon Sep 17 00:00:00 2001 From: Kristaps Berzinch Date: Wed, 20 Mar 2024 20:43:15 -0400 Subject: [PATCH] Improve subject line for TA creation if no payment is due --- app/Mail/Travel/TravelAssignmentCreated.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Mail/Travel/TravelAssignmentCreated.php b/app/Mail/Travel/TravelAssignmentCreated.php index e6afdb5e5..2af62f49b 100644 --- a/app/Mail/Travel/TravelAssignmentCreated.php +++ b/app/Mail/Travel/TravelAssignmentCreated.php @@ -49,7 +49,25 @@ public function build(): self private function subjectLineCallToAction(): string { - if ($this->assignment->needs_docusign || ! $this->assignment->user->has_emergency_contact_information) { + if ( + $this->assignment->needs_docusign && + $this->assignment->user->has_emergency_contact_information && + $this->assignment->travel->fee_amount === 0 + ) { + if ($this->assignment->travel->needs_airfare_form) { + if ($this->assignment->travel->needs_travel_information_form) { + return 'Forms'; + } else { + return 'Airfare request form'; + } + } else { + if ($this->assignment->travel->needs_travel_information_form) { + return 'Travel information form'; + } else { + return 'Form'; + } + } + } elseif ($this->assignment->needs_docusign || ! $this->assignment->user->has_emergency_contact_information) { return 'Action'; } else { return 'Payment';