diff --git a/backend/src/collective/volto/formsupport/captcha/configure.zcml b/backend/src/collective/volto/formsupport/captcha/configure.zcml index 194b1e2..81202fe 100644 --- a/backend/src/collective/volto/formsupport/captcha/configure.zcml +++ b/backend/src/collective/volto/formsupport/captcha/configure.zcml @@ -53,4 +53,9 @@ component=".vocabularies.captcha_providers_vocabulary_factory" /> + + diff --git a/backend/src/collective/volto/formsupport/captcha/vocabularies.py b/backend/src/collective/volto/formsupport/captcha/vocabularies.py index 8e91e53..351484b 100644 --- a/backend/src/collective/volto/formsupport/captcha/vocabularies.py +++ b/backend/src/collective/volto/formsupport/captcha/vocabularies.py @@ -1,4 +1,5 @@ from ..interfaces import ICaptchaSupport +from plone import api from zope.component import getAdapters from zope.interface import provider from zope.schema.interfaces import IVocabularyFactory @@ -13,3 +14,11 @@ def captcha_providers_vocabulary_factory(context): if adapter.isEnabled(): terms.append(SimpleTerm(value=name, token=name, title=adapter.name)) return SimpleVocabulary(terms) + + +@provider(IVocabularyFactory) +def mail_templates_vocabulary_factory(context): + name = "schemaform.mail_templates" + registry_record_value = api.portal.get_registry_record(name) + items = list(registry_record_value.keys()) + return SimpleVocabulary.fromItems([[item, item, item] for item in items])