Email & Newsletter Forms
Capture email signups with provider-agnostic EmailSubscribeForm, FooterCallToAction, submitFormData helper, and formRules.
Provider-Agnostic Philosophy
@nuxtify/pages (and @nuxtify/cms, which includes it) does not lock you into a specific newsletter or email marketing platform. Whether you use MailerLite, ConvertKit/Kit, Buttondown, Loops, Formspree, or your own Nuxt server route, you can either point Nuxtify's built-in EmailSubscribeForm at a POST endpoint or drop in your provider's embed.
Quick Setup with EmailSubscribeForm & FooterCallToAction
Configure your default submission URL and optional footer CTA copy in app.config.ts:
// app/app.config.ts
export default defineAppConfig({
nuxtify: {
email: {
provider: {
defaultSubmitUrl: 'https://your-provider.example.com/subscribe',
},
},
footer: {
cta: {
title: 'Stay in the loop',
subtitle: 'Get release notes and Nuxt tips in your inbox.',
color: 'primary',
},
},
},
})
Once email.provider.defaultSubmitUrl is set, FooterCallToAction renders EmailSubscribeForm automatically in the footer. You can also place EmailSubscribeForm directly in any Vue component or Markdown page:
<template>
<EmailSubscribeForm
:submit-url="nuxtifyConfig.email?.provider?.defaultSubmitUrl || '/api/subscribe'"
button-text="Join Waitlist"
email-placeholder="you@company.com"
marketing-consent-text="No spam. Unsubscribe any time."
show-privacy
thank-you-message="You're on the list!"
/>
</template>
EmailSubscribeForm Props
| Prop | Type | Default | Description |
|---|---|---|---|
submitUrl | string | Required | Endpoint URL that receives the POST FormData payload. |
buttonText | string | 'Subscribe' | Submit button label. |
emailPlaceholder | string | 'Enter your best email' | Input placeholder text. |
marketingConsentText | string | 'Unsubscribe any time.' | Supporting note rendered below the input. |
showPrivacy | boolean | false | Appends a link to nuxtify.routes.privacy beneath the form. |
redirectUrl | string | '' | Optional internal or external URL to navigate to after a successful signup. |
thankYouMessage | string | 'Thanks for signing up!' | Inline confirmation message shown when redirectUrl is omitted. |
dark | boolean | false | Adjusts validation and supporting text contrast for dark surfaces (used by FooterCallToAction). |
prependButtonIcon | string | '' | Optional MDI icon prepended to the submit button. |
appendButtonIcon | string | '' | Optional MDI icon appended to the submit button. |
What EmailSubscribeForm Sends
When a visitor submits a valid email address, EmailSubscribeForm:
- Validates the input with
formRules.requiredandformRules.validEmail. - Builds a
FormDatapayload withemail,referrer(current base URL), and any active UTM query parameters (utm_source,utm_medium,utm_campaign,utm_term,utm_content). - Submits via the auto-imported
submitFormData(submitUrl, formData)utility, triggersuseAnalytics().userSignUp()on success, and either redirects toredirectUrlor displaysthankYouMessage.
Using submitFormData Directly
If you're building a custom signup or contact form, you can reuse the submitFormData utility directly. It sends a POST request with FormData and returns a structured { isSubmitted, isError, errorMessage } result:
const formData = new FormData()
formData.append('email', email.value)
formData.append('name', name.value)
const { isSubmitted, isError, errorMessage } = await submitFormData('/api/contact', formData)
Building Custom Forms with formRules & AppToast
For custom contact forms, waitlists, or third-party embeds, combine Vuetify's <v-form> with Nuxtify's built-in formRules and global toast state (useToast + AppToast):
<script setup lang="ts">
import type { VForm } from 'vuetify/components'
const form = ref<VForm>()
const loading = ref(false)
const email = ref('')
const message = ref('')
const toast = useToast()
async function onSubmit() {
const result = await form.value?.validate()
if (!result?.valid) return
loading.value = true
const payload = new FormData()
payload.append('email', email.value)
payload.append('message', message.value)
const { isError, errorMessage } = await submitFormData('/api/contact', payload)
loading.value = false
toast.value.message = isError
? `Could not send message: ${errorMessage}`
: 'Message sent! We will reply shortly.'
toast.value.show = true
}
</script>
<template>
<v-form
ref="form"
validate-on="submit"
@submit.prevent="onSubmit"
>
<v-text-field
v-model="email"
label="Email"
type="email"
variant="outlined"
:rules="[formRules.required, formRules.validEmail]"
/>
<v-textarea
v-model="message"
label="Message"
variant="outlined"
:rules="[formRules.required, formRules.minLength12, formRules.maxLength1200]"
/>
<v-btn
type="submit"
color="secondary"
:loading="loading"
>
Send Message
</v-btn>
</v-form>
</template>
Nuxtify includes ready-to-use formRules validators for required values (required, requiredArray), email format (validEmail), string lengths (minLength8, minLength12, maxLength30 through maxLength10000), and numbers (isInteger, gt0, gte6, lte12, lte365).
Embedding Third-Party Forms
If your email provider requires its own script or iframe (for example, Substack, Beehiiv, or Tally), override FooterCallToAction.vue by creating app/components/FooterCallToAction.vue—or create a dedicated custom component in app/components/ and drop it straight into your Markdown pages with MDC syntax.
Next Steps
- Learn how to replace
FooterCallToActionorEmailSubscribeFormin Overriding Defaults. - Check
footer.ctaandemail.providerdefaults in Pages Options. - Inspect every prop and helper in App & Layout Components and Utilities.