Pergunta

I am wondering if it is possible to send an email before a certain date? To explain a bit more we have talks that run every month on the second Wednesday of the month and they have a title and speaker.

I would like to email the members (email addresses stored in member object) 2 weeks before each meeting so on the first of the month yet get this months talk. So is this possible? The dates for each talk are stored in the talk objects. The basic outline of the email would just consist of the information in this months talk object.

Foi útil?

Solução

You can use a cron job or, better yet, a message queuing service such as RabbitMQ or ZeroMQ. Celery is a project that wraps these message queuing services in a python/django module.

The way it would work is you'd write a function that would do your database queries and figure out which messages to send. You'd then decorate this function as a task and set a delayed execution time on it.

Outras dicas

Write a custom management command, that goes over the month talk objects, checks if there are talks scheduled for the next two weeks and sends email to the right members, and then run that command using a cron job every day.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top