The newsletter section atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt
Use this file to discover all available pages before exploring further.
/admin/newsletter lets you compose and send an email broadcast to all active subscribers. Delivery is handled by Resend.
This page is only accessible to users with the admin role. Editors are redirected to the dashboard.
Before you send
The top of the page shows the number of active subscribers who will receive the email. If that count is zero, the send button is disabled. Add subscribers by asking readers to sign up through the newsletter widget on the public site, or manage them at/admin/suscriptores.
Composing a newsletter
Write the subject
Enter the email subject in the Asunto del email field. Maximum 150 characters. Example:
Resumen semanal de noticias — TuPerfil.net.Write the content
Type the newsletter body in the Contenido del newsletter text area. You can use line breaks to separate paragraphs — they are preserved in the final email. Plain text is recommended for maximum compatibility across email clients.
Click the send button
The button shows exactly how many subscribers will receive the email: Enviar newsletter a N suscriptores.
Confirm the send
A confirmation panel appears asking you to confirm the action. Click Sí, enviar ahora to proceed, or Cancelar to go back and edit.
How delivery works
- The send button calls
POST /api/newsletter/sendwith the subject and body. - The API fetches all subscribers where
active = true, then sends individual emails via the Resend API. - Every email includes an unsubscribe link at the bottom, generated automatically. Clicking it sets
active = falseand recordsunsubscribed_atfor that subscriber. - Emails are sent from the address configured in the
RESEND_FROM_EMAILenvironment variable (defaults to[email protected]).
Notifying subscribers from an article
You do not need to visit this page to send a notification about a specific article. When creating or editing an article, enable the Notificar suscriptores toggle (visible only when the article is set to Publicada and not scheduled). Saving the article triggersPOST /api/newsletter/notify with the article title, excerpt, and featured image.
Newsletter fields reference
| Field | Max length | Notes |
|---|---|---|
| Subject | 150 chars | Required to enable the send button. |
| Body | Unlimited | Plain text. Line breaks are preserved. |
