NewsletterSection
NewsletterSection
Status: archived. This component lives under an
_archive/directory in the source repo and is not part of the actively-recommended UI surface. It ships in the published NPM tarball (1.2.3) but is not auto-imported by Nuxt because of the_archivepath prefix. Use it for legacy designs only — for new work preferXMarkSectionNewsletter, which is decoupled from any specific newsletter provider and emits/handles submission via the standardsubmitevent.
The XNewsletterSection component renders a full-page padding section (py-24) containing a centered, rounded, primary-bordered card with a heading, subheading, and a Nuxt UI UForm for email capture. The card's background is a CDN-hosted poof image plus a bg-primary/5 overlay by default — both are overridable.
Unlike XMarkSectionNewsletter, this component POSTs directly to the emailmarketingnewsletters.com public subscribe endpoint as part of the component itself. It does not emit a submit event for the consumer to handle. It also requires organizationId to be set.
Components
<XNewsletterSection />
<!-- Manual import required — not auto-imported -->
<script setup>
import XNewsletterSection from '@xenterprises/nuxt-x-marketing/app/components/X/_archive/Newsletter/Section.vue'
</script>
<template>
<XNewsletterSection
organization-id="org_abc123"
heading="Stay Up To Date"
subheading="Stay up to date with our latest news and product announcements."
submit-label="Subscribe"
/>
</template>
With custom card background:
<XNewsletterSection
organization-id="org_abc123"
card-class="bg-fit bg-center bg-no-repeat bg-primary/5"
card-style="background-image: url('https://cdn.example.com/my-bg.webp');"
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
heading | string | 'Stay Up To Date' | Card heading text. |
subheading | string | 'Stay up to date with our latest news and product announcements.' | Card supporting text. |
submitLabel | string | 'Subscribe' | Submit button label. |
cardClass | string | 'bg-fit bg-center bg-no-repeat bg-primary/5' | Additional Tailwind classes for the card. |
cardStyle | string | "background-image: url('https://cdn.x.enterprises/bg-subscription-poof2.webp');" | Inline style string for the card (use to override the background image). |
organizationId | string | required | The emailmarketingnewsletters.com organization ID to subscribe the email to. |
endpoint | string | 'https://api.emailmarketingnewsletters.com' | Base URL of the subscribe API. Override only if you self-host the emailmarketingnewsletters service. |
Behavior
- No
submitemit — submission is performed in-component via$fetch(${props.endpoint}/public/subscriptions/subscribe, { method: 'POST', body: { email, organizationId } }). - Validation:
zodschema checks thatemailis a valid email address before submit. - Success state: the form is hidden and a "Done! You have successfully subscribed." message is shown.
- Toast feedback: on success
toast.add({ icon: 'i-lucide-badge-check', title: 'You have successfully subscribed to our newsletter.' }); on failuretoast.add({ icon: 'i-lucide-alert-circle', title: 'An error occurred or you\'ve already subscribed.' }). - Loading state: the email input is set to
loadinganddisabledwhile the request is in flight.
Requirements
- Requires a Nuxt UI
UForm/UInput/UButtonsetup (the layer already provides these). - Requires a working
useToast()(provided by Nuxt UI's@nuxt/ui/toastplugin). - The remote service at
https://api.emailmarketingnewsletters.commust be reachable from the browser (CORS-allowed) for the form to function.
AI Context
category: Newsletter
package: "@xenterprises/nuxt-x-marketing"
components:
- XNewsletterSection
status: archived
use-when: >
Legacy standalone newsletter signup that posts directly to the
emailmarketingnewsletters.com public subscribe API and needs no consumer
wiring. Prefer XMarkSectionNewsletter for new designs — it's provider-agnostic
and emits a `submit` event for the consumer to handle.
typical-page-section: Mid-page or end-of-page standalone newsletter CTA.
import: >
Not auto-imported (path begins with `_archive/`). Import explicitly:
import XNewsletterSection from '@xenterprises/nuxt-x-marketing/app/components/X/_archive/Newsletter/Section.vue'
Archived: SectionStitch
Archived — SVG section divider with 5 shape variants (angle, wave, curve, triangle, zigzag), configurable top/bottom colors, height preset, flip, and optional center glow line.
NewsletterForm
Archived — full-width newsletter signup section with 3 variants (dark, light, transparent), optional zip code field, disclaimer, and submit event.
