Skip to content

Commit

Permalink
Added: support for disable_default_emails in __config__ (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
signebedi committed Sep 29, 2024
1 parent 6067bcb commit ccb8526
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libreforms_fastapi/utils/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ccb8526

Please sign in to comment.