Skip to content

Pass send_mail return values through backend.deliver #100

@powderflask

Description

@powderflask

Problem:
backend.deliver returns True when backend.can_send, regardless of potential issues in, e.g., smtp backend
For example, if the SMTP connection fails, backend.deliver still returns True.

This means I can't detect and handle cases where an important notification is not sent.

Proposed Solution:
backend.deliver currently returns nothing, so could be adapted to pass along value from underlying backend (e.g., send_mail)
models.send_now (and other send functions) returns True or False. I'd recommend returning True only if notification was successfully sent by at least one backend.

Have not considered alternatives nor looked too deeply into the implications for other backend types. Wanted to ask if this is something you'd consider a pull-request for before going further?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions