Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve ValueError message on invalid email.transport_class #1318

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/viur/core/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ def send_email(
# First, ensure we're able to send email at all
transport_class = conf.email.transport_class # First, ensure we're able to send email at all
if not isinstance(transport_class, EmailTransport):
raise ValueError(f"No or invalid email transportclass specified! ({transport_class=})")
raise ValueError(
f"No or invalid email transport class specified! ({transport_class=}). "
"In ViUR-core >= 3.7 the transport_class must be an instanced object, so maybe it's "
f"`conf.email.transport_class = {transport_class.__name__}()` which must be assigned."
)

# Ensure that all recipient parameters (dest, cc, bcc) are a list
dests = normalize_to_list(dests)
Expand Down
Loading