church-website/src/collections/blocks/Contactform.ts
2026-03-06 15:37:10 +01:00

45 lines
No EOL
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Block } from 'payload'
import { siteConfig } from '@/config/site'
export const ContactformBlock: Block = {
slug: 'contactform',
labels: {
singular: {
de: "Kontaktformular"
},
plural: {
de: 'Kontaktformular'
}
},
fields: [
{
name: 'title',
type: 'text',
required: true,
defaultValue: 'Ich bin dabei!',
label: {
de: 'Titel'
}
},
{
name: 'description',
type: 'textarea',
label: {
de: 'Werbetext'
},
defaultValue: "Um dich anzumelden oder uns zu unterstützen, fülle bitte das Kontaktformular aus. Wir freuen uns sehr, dass du Teil unserer Gemeinschaft bist und mit deinem Engagement dazu beiträgst, unsere Ziele zu erreichen. Solltest du Fragen haben oder weitere Informationen benötigen, zögere nicht, uns zu kontaktieren wir sind gerne für dich da!",
required: true
},
{
name: 'email',
type: 'email',
defaultValue: async ({ req }) => {
const config = await req.payload.findGlobal({
slug: 'site-config',
})
return config?.email || siteConfig.email
},
required: true,
}
]
}