{{-- Utskick för samtycke form (DESIGN.md Page patterns 3; #2957 slice 3d, card #3017). Posts the same fields as the old form to sendout.consent: subject, start_time, sender_profile, language (se|en), content (TinyMCE HTML, bold and italic) and receiverList[] plus _token. SendoutController::consent() stores start_time as posted, so sendout-form.js writes it as "Y-m-d H:i:s" like the old datetimepicker did. The receivers step, the sender and time step, the summary and the dialog are shared with Skapa utskick (sendout/partials/nh-*.blade.php). The second form after the main one posts content and lang into the preview iframe, as before. --}} {{-- Shared data ($company, $senders, $lists, $checked, $scheduled, $i18n and more) comes from App\Support\SendoutFormData::forConsent(). --}} @php // The old select defaulted to the company's main language when that is "se" or "en", else to the first option. $languages = ['se' => 'languageSe', 'en' => 'languageEn']; $wantedLanguage = (string) (old('language') ?: $company->main_language_id); $selectedLanguage = array_key_exists($wantedLanguage, $languages) ? $wantedLanguage : 'se'; // The old consent form made no monthly limit check before sending. $emailLimit = null; $initialStep = $errors->has('subject') || $errors->has('content') || $errors->has('language') ? 'letter' : ($errors->has('receiverList') || $errors->has('receiverList.*') ? 'receivers' : ($errors->has('sender_profile') || $errors->has('start_time') ? 'sender' : 'letter')); @endphp
@include('sendout.partials.nh-confirm-dialog') {{-- Posts the text and language into the preview iframe (NewsletterController::consentTemplate), as the old hidden form did. --}}