diff --git a/frontend/packages/volto-form-block/locales/de/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/de/LC_MESSAGES/volto.po index 724a86c..b2e4d47 100644 --- a/frontend/packages/volto-form-block/locales/de/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/de/LC_MESSAGES/volto.po @@ -779,7 +779,12 @@ msgstr "Wenn das Feld nicht ausgefüllt ist, wird ein Standardtext verwendet" #. Default: "Text at the beginning of the email" #: formSchema msgid "mail_header_label" -msgstr "" +msgstr "Text am Anfang der E-Mail" + +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "Mail-Vorlage" #. Default: "Number" #: index diff --git a/frontend/packages/volto-form-block/locales/en/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/en/LC_MESSAGES/volto.po index fb3bbf0..5baafb3 100644 --- a/frontend/packages/volto-form-block/locales/en/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/en/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/es/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/es/LC_MESSAGES/volto.po index cc17ad8..5ee99bd 100644 --- a/frontend/packages/volto-form-block/locales/es/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/es/LC_MESSAGES/volto.po @@ -787,6 +787,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/eu/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/eu/LC_MESSAGES/volto.po index dbc5bcf..9ec5958 100644 --- a/frontend/packages/volto-form-block/locales/eu/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/eu/LC_MESSAGES/volto.po @@ -783,6 +783,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/fr/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/fr/LC_MESSAGES/volto.po index 11b0809..aba2894 100644 --- a/frontend/packages/volto-form-block/locales/fr/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/fr/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/it/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/it/LC_MESSAGES/volto.po index e4eeebe..28a0cf1 100644 --- a/frontend/packages/volto-form-block/locales/it/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/it/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "Se il campo non viene compilato verrà utilizzato un testo di default" msgid "mail_header_label" msgstr "Testo all'inizio dell'email" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/ja/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/ja/LC_MESSAGES/volto.po index 072ccba..665e089 100644 --- a/frontend/packages/volto-form-block/locales/ja/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/ja/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/nl/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/nl/LC_MESSAGES/volto.po index bedf32a..ca241e3 100644 --- a/frontend/packages/volto-form-block/locales/nl/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/nl/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/pt/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/pt/LC_MESSAGES/volto.po index 072ccba..665e089 100644 --- a/frontend/packages/volto-form-block/locales/pt/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/pt/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/pt_BR/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/pt_BR/LC_MESSAGES/volto.po index f22a86e..603d59f 100644 --- a/frontend/packages/volto-form-block/locales/pt_BR/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/pt_BR/LC_MESSAGES/volto.po @@ -787,6 +787,11 @@ msgstr "Se o campo não for preenchido, um texto padrão será usado" msgid "mail_header_label" msgstr "Texto no início do e-mail." +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/ro/LC_MESSAGES/volto.po b/frontend/packages/volto-form-block/locales/ro/LC_MESSAGES/volto.po index 6e9cc29..c6549f1 100644 --- a/frontend/packages/volto-form-block/locales/ro/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-form-block/locales/ro/LC_MESSAGES/volto.po @@ -781,6 +781,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/locales/volto.pot b/frontend/packages/volto-form-block/locales/volto.pot index 4d95dc8..69d134d 100644 --- a/frontend/packages/volto-form-block/locales/volto.pot +++ b/frontend/packages/volto-form-block/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-12-03T14:37:51.085Z\n" +"POT-Creation-Date: 2024-12-17T18:05:44.148Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -783,6 +783,11 @@ msgstr "" msgid "mail_header_label" msgstr "" +#. Default: "Mail template" +#: schemaFormBlock/schema +msgid "mail_template" +msgstr "" + #. Default: "Number" #: index msgid "number" diff --git a/frontend/packages/volto-form-block/src/index.js b/frontend/packages/volto-form-block/src/index.js index f908eec..31464a5 100644 --- a/frontend/packages/volto-form-block/src/index.js +++ b/frontend/packages/volto-form-block/src/index.js @@ -99,6 +99,7 @@ const applyConfig = (config) => { fieldSchema: FieldSchema, captchaProvidersVocabulary: 'collective.volto.formsupport.captcha.providers', + mailTemplatesVocabulary: 'collective.volto.formsupport.mail.templates', disableEnter: true, filterFactory: [ 'label_text_field', diff --git a/frontend/packages/volto-form-block/src/schemaFormBlock/schema.js b/frontend/packages/volto-form-block/src/schemaFormBlock/schema.js index 7522025..c67cdea 100644 --- a/frontend/packages/volto-form-block/src/schemaFormBlock/schema.js +++ b/frontend/packages/volto-form-block/src/schemaFormBlock/schema.js @@ -188,6 +188,10 @@ const messages = defineMessages({ id: 'fieldset_confirmation', defaultMessage: 'Confirmation-Page', }, + mail_template: { + id: 'mail_template', + defaultMessage: 'Mail template', + }, }); const defaultEmptyData = { @@ -239,7 +243,7 @@ export const schemaFormBlockSchema = ({ intl, ...props }) => { fields: [ 'send_confirmation', ...(data?.send_confirmation - ? ['confirmation_recipients', 'fixed_attachment'] + ? ['confirmation_recipients', 'fixed_attachment', 'mail_template'] : []), 'send', ...(data?.send ? ['recipients', 'bcc', 'admin_info'] : []), @@ -303,8 +307,11 @@ export const schemaFormBlockSchema = ({ intl, ...props }) => { captcha: { title: intl.formatMessage(messages.captcha), type: 'string', - vocabulary: - config.blocks?.blocksConfig?.schemaForm?.captchaProvidersVocabulary, + factory: 'Choice', + vocabulary: { + '@id': + config.blocks?.blocksConfig?.schemaForm?.captchaProvidersVocabulary, + }, }, send: { type: 'boolean', @@ -386,6 +393,15 @@ export const schemaFormBlockSchema = ({ intl, ...props }) => { type: 'object', widget: 'file', }, + mail_template: { + title: intl.formatMessage(messages.mail_template), + type: 'string', + factory: 'Choice', + vocabulary: { + '@id': + config.blocks?.blocksConfig?.schemaForm?.mailTemplatesVocabulary, + }, + }, }, required: conditional_required, };