From b8e97b62c1e0aa1183bd5447edfa83e260ed2e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Carodej?= Date: Thu, 30 Jun 2022 10:49:18 +0200 Subject: [PATCH] added index and button into DunningEmailToCoverAccountUsageNotification --- .../DunningEmailToCoverAccountUsageNotification.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Domain/Subscriptions/Notifications/DunningEmailToCoverAccountUsageNotification.php b/src/Domain/Subscriptions/Notifications/DunningEmailToCoverAccountUsageNotification.php index f80b8b27..2985a1d4 100644 --- a/src/Domain/Subscriptions/Notifications/DunningEmailToCoverAccountUsageNotification.php +++ b/src/Domain/Subscriptions/Notifications/DunningEmailToCoverAccountUsageNotification.php @@ -24,21 +24,24 @@ class DunningEmailToCoverAccountUsageNotification extends Notification implement public function toMail(): MailMessage { $message = $this->dunningMessages(); + $index = $this->dunning->sequence - 1; return (new MailMessage) - ->subject($message[$this->dunning->type][$this->dunning->sequence]['subject']) + ->subject($message[$this->dunning->type][$index]['subject']) ->greeting(__('Hi there')) - ->line($message[$this->dunning->type][$this->dunning->sequence]['line']) + ->line($message[$this->dunning->type][$index]['line']) + ->action(__t('show_billing'), url('/user/settings/billing')) ->salutation(__('Regards')); } public function toArray(): array { $message = $this->dunningMessages(); + $index = $this->dunning->sequence - 1; return [ 'category' => 'payment-alert', - 'title' => $message[$this->dunning->type][$this->dunning->sequence]['subject'], + 'title' => $message[$this->dunning->type][$index]['subject'], 'description' => __t('dunning_notification_description'), 'action' => [ 'type' => 'route',