return number of messages sent in send_messages

Issue #2 resolved
Jason Moiron
created an issue

The SMTP backend has this docstring:

    Sends one or more EmailMessage objects and returns the number of email messages sent.

Since the task is deferred and we can have no idea whether or not email is sent successfully anyway, I think that send_messages should just return len(email_messages) so that it at least doesn't always return a "failure" result.

Comments (2)

  1. Paul McLanahan repo owner

    The task is set by default to not send a result at all. If it fails it'll retry until your max retry setting is reached. If it fails completely it'll log that. I'm just not sure how returning a value that provides no information is better than just ignoring the result.

  2. Paul McLanahan repo owner

    Version 1.0 added a return value to the backend. It now returns a list of the AsyncResult objects returned by the tasks. The len() of this list will give you the number of messages you gave it, but it's also useful for other things. See the README for more.

  3. Log in to comment