Skip to content

Commit b0f2702

Browse files
authored
Update StructureUnderAttack Mail notification so it actually works (#112)
* Update StructureUnderAttack.php Updated sprintf to have the correct number of arguments for the mail notification for structure attacks. This resolves eveseat/seat#864 * Fixed style * Fixed style
1 parent b2fdbbb commit b0f2702

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Notifications/Structures/Mail/StructureUnderAttack.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
use Illuminate\Notifications\Messages\MailMessage;
2626
use Seat\Eveapi\Models\Character\CharacterNotification;
27+
use Seat\Eveapi\Models\Sde\InvType;
2728
use Seat\Eveapi\Models\Sde\MapDenormalize;
29+
use Seat\Eveapi\Models\Universe\UniverseStructure;
2830
use Seat\Notifications\Notifications\AbstractMailNotification;
2931
use Seat\Notifications\Traits\NotificationTools;
3032

@@ -59,12 +61,19 @@ public function __construct(CharacterNotification $notification)
5961
public function toMail($notifiable)
6062
{
6163
$system = MapDenormalize::find($this->notification->text['solarsystemID']);
64+
$structure = UniverseStructure::find($this->notification->text['structureID']);
65+
$type = InvType::find($this->notification->text['structureShowInfoData'][1]);
66+
$title = 'Structure';
67+
if (! is_null($structure)) {
68+
$title = $structure->name;
69+
}
70+
$structureType = $type->typeName;
6271

6372
return (new MailMessage)
6473
->subject('Structure Under Attack Notification')
6574
->line('A structure is under attack!')
6675
->line(
67-
sprintf('Citadel (%s, "%s") attacked')
76+
sprintf('Citadel (%s, "%s") attacked', $title, $structureType)
6877
)
6978
->line(
7079
sprintf('(%d shield, %d armor, %d hull)',

0 commit comments

Comments
 (0)