diff --git a/app/Http/Controllers/Admin/MailwizzController.php b/app/Http/Controllers/Admin/MailwizzController.php index 32a4f56..ce644ad 100644 --- a/app/Http/Controllers/Admin/MailwizzController.php +++ b/app/Http/Controllers/Admin/MailwizzController.php @@ -8,18 +8,29 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Admin\UpdateMailwizzConfigRequest; use App\Models\PreregistrationPage; use Illuminate\Http\RedirectResponse; +use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\View\View; class MailwizzController extends Controller { - public function edit(PreregistrationPage $page): View + public function edit(Request $request, PreregistrationPage $page): View|RedirectResponse { $this->authorize('update', $page); - $page->load('mailwizzConfig'); + $page->load(['mailwizzConfig', 'weeztixConfig']); - return view('admin.mailwizz.edit', compact('page')); + $config = $page->mailwizzConfig; + $showWizard = $config === null || $request->boolean('wizard'); + if ($showWizard && $config === null) { + $requestedStep = min(4, max(1, (int) $request->query('step', 1))); + if ($requestedStep !== 1) { + return redirect() + ->route('admin.pages.mailwizz.edit', ['page' => $page, 'wizard' => 1, 'step' => 1]); + } + } + + return view('admin.mailwizz.edit', compact('page', 'showWizard')); } public function update(UpdateMailwizzConfigRequest $request, PreregistrationPage $page): RedirectResponse diff --git a/lang/nl.json b/lang/nl.json index 33e95e3..5660fc7 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -14,6 +14,7 @@ "Sending…": "Bezig met verzenden…", "Something went wrong. Please try again.": "Er ging iets mis. Probeer het opnieuw.", "This pre-registration period has ended.": "Deze preregistratieperiode is afgelopen.", + "You will be redirected in :seconds s…": "Je wordt over :seconds seconden doorgestuurd…", "Visit ticket shop": "Ga naar de ticketshop", "Thank you for registering!": "Bedankt voor je registratie!", "You are already registered for this event.": "Je bent al geregistreerd voor dit evenement.", diff --git a/resources/views/admin/mailwizz/edit.blade.php b/resources/views/admin/mailwizz/edit.blade.php index a33a6b9..0799ed2 100644 --- a/resources/views/admin/mailwizz/edit.blade.php +++ b/resources/views/admin/mailwizz/edit.blade.php @@ -2,6 +2,7 @@ $config = $page->mailwizzConfig; $page->loadMissing('weeztixConfig'); $hasWeeztixForCouponMap = $page->weeztixConfig !== null && $page->weeztixConfig->is_connected; + $mailwizzStatus = $page->mailwizzIntegrationStatus(); $existing = $config !== null ? [ 'list_uid' => $config->list_uid, @@ -24,30 +25,15 @@ @section('mobile_title', __('Mailwizz')) @section('content') -
{{ __('Please fix the following:') }}
@@ -59,219 +45,347 @@{{ __('Integration active') }}
-- {{ __('List:') }} - {{ $config->list_name ?: $config->list_uid }} -
-{{ __('The API key is stored encrypted and is not shown here.') }}
-- {{ __('First, create a mailing list in Mailwizz with the required custom fields. Add a custom field of type Checkbox List with an option value you will use to track this pre-registration source.') }} -
+{{ __('Mailwizz custom fields are matched by tag.') }}
+- {{ __('Enter your API key and connect to load Mailwizz data (the same key as before is fine). If you clear the key field before saving, the previously stored key is kept.') }} -
+ @endif -{{ __('Map each local field to the matching Mailwizz custom field (by tag).') }}
- -{{ __('Koppel aan een tekstveld in Mailwizz om de persoonlijke code in e-mails te tonen.') }}
- -- {{ __('No checkbox list fields were returned for this list. Add one in Mailwizz, then run “Load fields” again from step 2.') }} -
-{{ __('Choose the checkbox option that marks subscribers from this pre-registration page.') }}
- - -- {{ __('This field has no options defined in Mailwizz. Add options to the checkbox list field, then reload fields.') }} -
- -