HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/ai.naniguide.com/app/Services/Form/FormSuccessMessageTemplates.php
<?php

namespace App\Services\Form;

/**
 * F4.4 — Static catalog of success-message templates per (angle, tone).
 *
 * 9 templates total: 3 angles × 3 tones. Runtime SoT for
 * `form.suggest_success_msg`; mirrors `form.json` →
 * `entities.success_message_templates[]`. F38 Pest reflection asserts
 * dual-source parity (D80).
 */
class FormSuccessMessageTemplates
{
    public const ANGLES = ['confirmation_first', 'value_prop_first', 'next_step_first'];

    public const TONES = ['warm', 'professional', 'playful'];

    /**
     * @return list<array{id:string,angle:string,tone:string,text:string}>
     */
    public static function templates(): array
    {
        return [
            ['id' => 'confirmation_first.warm', 'angle' => 'confirmation_first', 'tone' => 'warm', 'text' => 'Thanks for signing up to {list_name}! We\'ve sent you a confirmation email — open it and click the link to finish. We\'re excited to have you.'],
            ['id' => 'confirmation_first.professional', 'angle' => 'confirmation_first', 'tone' => 'professional', 'text' => 'Your subscription to {list_name} is pending confirmation. We\'ve emailed a confirmation link — click it to activate your subscription.'],
            ['id' => 'confirmation_first.playful', 'angle' => 'confirmation_first', 'tone' => 'playful', 'text' => 'Almost in! We just sent a confirmation email for {list_name}. Click the link inside and you\'re official.'],
            ['id' => 'value_prop_first.warm', 'angle' => 'value_prop_first', 'tone' => 'warm', 'text' => 'Welcome to {list_name}! You\'ll get our best {topic} content straight to your inbox. Check your email to confirm — it takes one click.'],
            ['id' => 'value_prop_first.professional', 'angle' => 'value_prop_first', 'tone' => 'professional', 'text' => 'You\'ve subscribed to {list_name}. Expect curated {topic} updates on a regular cadence. Confirm via the email we just sent to activate delivery.'],
            ['id' => 'value_prop_first.playful', 'angle' => 'value_prop_first', 'tone' => 'playful', 'text' => 'You\'re in for the good stuff — {list_name} delivers {topic} you\'ll actually want to read. Hop into your inbox and confirm to get started.'],
            ['id' => 'next_step_first.warm', 'angle' => 'next_step_first', 'tone' => 'warm', 'text' => 'Almost there — please check your inbox. We sent you a confirmation link for {list_name}. Once you click it, you\'re all set.'],
            ['id' => 'next_step_first.professional', 'angle' => 'next_step_first', 'tone' => 'professional', 'text' => 'Next step: open the email we just sent and click the confirmation link. Your subscription to {list_name} activates immediately afterward.'],
            ['id' => 'next_step_first.playful', 'angle' => 'next_step_first', 'tone' => 'playful', 'text' => 'Just one more click — head to your inbox, find our email, and tap the big confirm button. {list_name} starts the moment you do.'],
        ];
    }

    /**
     * @return list<array{id:string,angle:string,tone:string,text:string}>
     */
    public static function templatesForTone(string $tone): array
    {
        return array_values(array_filter(self::templates(), fn (array $t) => $t['tone'] === $tone));
    }

    /**
     * @return list<string>
     */
    public static function templateIds(): array
    {
        return array_map(fn (array $t) => $t['id'], self::templates());
    }
}