diff --git a/libreforms_fastapi/utils/pydantic_models.py b/libreforms_fastapi/utils/pydantic_models.py index 089f20d..bc383d8 100644 --- a/libreforms_fastapi/utils/pydantic_models.py +++ b/libreforms_fastapi/utils/pydantic_models.py @@ -598,6 +598,9 @@ class Config: 'on_confirm', ]} + # Here, we determine whether and which default email templates ought to be sent, see + # https://github.com/signebedi/libreforms-fastapi/issues/356. + disable_default_emails: bool | list = _config.get("disable_default_emails", False) # Here we provide for approval stages, see discussion in # https://github.com/signebedi/libreforms-fastapi/issues/62 @@ -674,6 +677,10 @@ class Config: dynamic_model.user_fields = user_fields dynamic_model.form_fields = form_fields + # Attach the default email template poolice to the dynamic model, see + # https://github.com/signebedi/libreforms-fastapi/issues/356 + dynamic_model.disable_default_emails = disable_default_emails + # Attach event hook attr to the dynamic model, see # https://github.com/signebedi/libreforms-fastapi/issues/62 dynamic_model.form_stages = form_stages