From 6eaaff513c50422f72fbb95e3afab08e2d879fec Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Thu, 10 Nov 2022 02:15:42 +0000 Subject: [PATCH] Handle fortnightly digests, empty digests --- app/Mail/Digest.php | 3 ++ resources/views/emails/digest.blade.php | 40 ++++++++++++++----------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/app/Mail/Digest.php b/app/Mail/Digest.php index 4de5749..bfaf608 100644 --- a/app/Mail/Digest.php +++ b/app/Mail/Digest.php @@ -55,6 +55,9 @@ class Digest extends Mailable case 'weekly': $cutoffDateTime->modify('-1 week'); break; + case 'fortnightly': + $cutoffDateTime->modify('-2 weeks'); + break; case 'monthly': $cutoffDateTime->modify('-1 month'); break; diff --git a/resources/views/emails/digest.blade.php b/resources/views/emails/digest.blade.php index 131247d..166f215 100644 --- a/resources/views/emails/digest.blade.php +++ b/resources/views/emails/digest.blade.php @@ -37,21 +37,25 @@

View the tracker here.


Checkins

-
    -@foreach($checkins as $checkin) -
  1. -
    - -

    {!! $checkin->title ?? "Untitled" !!}

    -

    {!! render_date_difference($checkin->date) !!}

    -
    - @if($checkin->note) - {!! $checkin->note !!} - @endif - @if($checkin->image_url) - - @endif -
    -
  2. -@endforeach -
+@if($checkins) +
    + @foreach($checkins as $checkin) +
  1. +
    + +

    {!! $checkin->title ?? "Untitled" !!}

    +

    {!! render_date_difference($checkin->date) !!}

    +
    + @if($checkin->note) + {!! $checkin->note !!} + @endif + @if($checkin->image_url) + + @endif +
    +
  2. + @endforeach +
+@else +

No new checkins

+@endif