Skip to content

Commit

Permalink
Add mail_templates setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
robgietema committed Dec 17, 2024
1 parent 477f020 commit db614fa
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
7 changes: 6 additions & 1 deletion frontend/packages/volto-form-block/locales/volto.pot
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -783,6 +783,11 @@ msgstr ""
msgid "mail_header_label"
msgstr ""

#. Default: "Mail template"
#: schemaFormBlock/schema
msgid "mail_template"
msgstr ""

#. Default: "Number"
#: index
msgid "number"
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/volto-form-block/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
22 changes: 19 additions & 3 deletions frontend/packages/volto-form-block/src/schemaFormBlock/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ const messages = defineMessages({
id: 'fieldset_confirmation',
defaultMessage: 'Confirmation-Page',
},
mail_template: {
id: 'mail_template',
defaultMessage: 'Mail template',
},
});

const defaultEmptyData = {
Expand Down Expand Up @@ -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'] : []),
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit db614fa

Please sign in to comment.