{{ define "test-send.pages.tmpl" }}
{{ template "head" . }}

<body>
  <section class="section">
    <div class="container">
      <h1 class="title">📤 Test envoi de message WhatsApp - Template</h1>

      <form hx-post="/api/message/send2" hx-trigger="submit" hx-target="#template-result" hx-swap="innerHTML">
        <div class="field">
          <label class="label">Numéro WhatsApp</label>
          <div class="control">
            <input class="input" name="to" placeholder="ex: 33612345678" required>
          </div>
        </div>

        <div class="field">
          <label class="label">Nom du template</label>
          <div class="control">
            <input class="input" name="template_name" value="rappel_demande_info" required>
          </div>
        </div>

        <div class="field">
          <label class="label">Langue</label>
          <div class="control">
            <input class="input" name="language" value="fr" required>
          </div>
        </div>

        <div class="field">
          <label class="label">Paramètre 1</label>
          <div class="control">
            <input class="input" name="param1" value="Jean">
          </div>
        </div>

        <div class="field">
          <label class="label">Paramètre 2 (optionnel)</label>
          <div class="control">
            <input class="input" name="param2">
          </div>
        </div>

        <button class="button is-link" type="submit" hx-ext="json-enc">Envoyer le template</button>
      </form>

      <div id="template-result" class="mt-4"></div>
    </div>
  </section>
</body>
{{ end }}
