GithubHelp home page GithubHelp logo

Comments (7)

embedded1 avatar embedded1 commented on June 19, 2024

An easy solution is to use order_by(priority) and set 0 to be the higher priority(now) and so on.

from django-post_office.

selwin avatar selwin commented on June 19, 2024

An easy way to do this would be to change the order_by argument in line 175 to order_by('-priority', 'id') so mails get sent out by priority and from oldest to newest.

I don't want to merge this into post_office because ordering by two columns could be an expensive operation when you have hundreds of thousands or millions of emails to send, but that's how I would do it :).

from django-post_office.

embedded1 avatar embedded1 commented on June 19, 2024

I don't want to patch the official release.
Could you please add an option to send out mails based on the created attribute instead of using the priority attribute?

this can be configure using a settings parameter while keeping the default behavior as it now which is by priority.

from django-post_office.

selwin avatar selwin commented on June 19, 2024

I suppose we could take an optional SENDING_ORDER so you'd be able to do this:

POST_OFFICE = {
    'SENDING_ORDER': ['-id', '-priority']
}

Pull request welcome :)

from django-post_office.

embedded1 avatar embedded1 commented on June 19, 2024

OK, this would be great, for my needs I would order by the created attribute to send emails with the FIFO order.

I will add the pull request.
10x

from django-post_office.

embedded1 avatar embedded1 commented on June 19, 2024

pull request submitted.

from django-post_office.

selwin avatar selwin commented on June 19, 2024

Fixed in #87

from django-post_office.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.