45 lines
No EOL
1.2 KiB
TypeScript
45 lines
No EOL
1.2 KiB
TypeScript
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,
|
||
}
|
||
]
|
||
} |