Opened 86 minutes ago
#36908 new Cleanup/optimization
Email docs "quick example" shows unnecessary `fail_silently` param
| Reported by: | Mike Edmunds | Owned by: | |
|---|---|---|---|
| Component: | Documentation | Version: | 6.0 |
| Severity: | Normal | Keywords: | docs email fail_silently |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The Quick examples section in the email docs includes fail_silently=False:
from django.core.mail import send_mail send_mail( "Subject here", "Here is the message.", "from@example.com", ["to@example.com"], fail_silently=False, )
fail_silently is an optional param defaulting to False. Showing it in the "straightforward" example suggests it's required or has some other default, encouraging users to unnecessarily include it in their own code. We should remove it from the example.
With the current django.core.mail implementation this isn't a huge deal, but needless use of fail_silently may interact poorly with other changes being contemplated in the email code (#35514).