Skip to content

Commit

Permalink
Improve subject line for TA creation if no payment is due
Browse files Browse the repository at this point in the history
  • Loading branch information
kberzinch committed Mar 21, 2024
1 parent 6d07578 commit ae963d4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion app/Mail/Travel/TravelAssignmentCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ae963d4

Please sign in to comment.