<?php

namespace EasyLinkAutomations\HTTP\Controllers\Triggers;

if (!defined('ABSPATH')) {
    exit;
}

use EasyLinkAutomations\HTTP\Request\Request;
use EasyLinkAutomations\HTTP\Response;

/**
 * Controller for Newsletter trigger endpoints.
 */
final class NewsletterController
{
    /**
     * Return form fields for a Newsletter subscription form.
     *
     * Route: newsletter/form-fields
     */
    public function formFields(Request $request): Response
    {
        // Newsletter subscription fields are standardized.
        $fields = [
            'email'     => 'Email',
            'list_id'   => 'List ID',
            'list_name' => 'List Name',
        ];

        return Response::success(['fields' => $fields]);
    }
}
