@extends('layouts.dashboard') @section('title', __('Automation')) @section('page_title', __('Marketing Automation')) @section('content') @include('partials.how-it-works', ['key' => 'automation.index'])
{{ __('Lifecycle emails') }}
{{ __('Runs hourly. Each person gets a given message once — never a repeat.') }}
@if($mailer === 'log'){{ __('Mailer is "log" — emails are written to the log, not sent') }}@endif
@csrf @method('PUT')
@foreach($rules as $key => $r)
{{ $r['sent_30d'] }} {{ __('sent / 30d') }}

{{ $r['description'] }}

@php($tk = ['abandoned_cart' => ['automation_abandoned_cart_hours', 'hours after the cart was last touched'], 'inactive_learner' => ['automation_inactive_learner_days', 'days without progress'], 'completion_followup' => ['automation_completion_followup_hours', 'hours after completing'], 'membership_expiring' => ['automation_membership_expiring_days', 'days before it ends']][$key])
{{ __($tk[1]) }}
@if($r['failed_30d'])
{{ __(':count failed', ['count' => $r['failed_30d']]) }}
@endif
@endforeach
@foreach($rules as $key => $r)
@csrf
@endforeach
{{ __('Recent sends') }}
@forelse($logs as $l) @empty@endforelse
{{ __('When') }}{{ __('Rule') }}{{ __('To') }}{{ __('Status') }}{{ __('Note') }}
{{ $l->created_at->format('d M H:i') }}{{ __(\Modules\Automation\Services\Automation::RULES[$l->rule][0] ?? $l->rule) }}{{ $l->user?->email }} {{ status_label($l->status) }}{{ Str::limit($l->note, 70) }}
{{ __('Nothing sent yet.') }}
@endsection