@extends('layouts.admin') @section('title', 'Distribution & Invitations') @section('header', 'Distribution & Invitations') @section('subheader', $survey->title) @section('header-actions') Back to Survey @endsection @php $defaultBody = "Dear Colleague, You are invited to participate in the " . $survey->title . ". Your feedback is valuable and will help us improve our workplace. Click the link below to start the survey: {survey_link} This survey is anonymous and will take approximately " . ($survey->estimated_minutes ?? 10) . " minutes to complete. Thank you for your participation. Best regards, " . ($survey->company->name ?? 'HR Team'); @endphp @section('content')

Distribution Links

@if($links->count() > 0)
@foreach($links as $link) @endforeach
@else

No distribution links yet.

Create a link to share the survey.

@endif

Email Invitations

@csrf

Enter one email per line, or separate with commas

Import from CSV

@csrf

CSV should have an 'email' column header

Email Template

@csrf

Available placeholders: {survey_link}, {recipient_email}, {company_name}

Invitation Stats

{{ $stats['total'] }}
Total
{{ $stats['sent'] }}
Sent
{{ $stats['pending'] }}
Pending
{{ $stats['completed'] }}
Completed
@if($stats['total'] > 0)
Response Rate {{ round(($stats['completed'] / $stats['total']) * 100) }}%
@endif
@if($stats['pending'] > 0)

Send Reminders

Send reminder emails to {{ $stats['pending'] }} people who haven't completed the survey.

@csrf
@endif

Survey Info

Company

{{ $survey->company->name ?? 'N/A' }}

Status

{{ ucfirst($survey->status) }}

Responses

{{ $responseCount }}

@if($invitations->count() > 0)

Invitation List

{{ $invitations->total() }} invitations
@foreach($invitations as $invitation) @endforeach
Email Status Sent At Completed At Actions
{{ $invitation->email }} @if($invitation->completed_at) Completed @elseif($invitation->sent_at) Sent @else Pending @endif {{ $invitation->sent_at ? $invitation->sent_at->format('M d, Y H:i') : '-' }} {{ $invitation->completed_at ? $invitation->completed_at->format('M d, Y H:i') : '-' }} @if(!$invitation->completed_at && $invitation->sent_at)
@csrf
@endif
@csrf @method('DELETE')
@if($invitations->hasPages())
{{ $invitations->links() }}
@endif
@endif @endsection