Messaging utils

kiki.utils.message.sanitize_headers(msg)

Set and modify headers on an email.Message that need to be there no matter which list the message ends up being delivered to. Also remove headers that need to not be there.

kiki.utils.message.set_list_headers(msg, list_)

Modifies the headers of a django.core.mail.EmailMessage in-place for a specific list.

kiki.utils.message.set_user_headers(msg, user)

Modifies the headers of a django.core.mail.EmailMessage in-place for a specific user.

Routing utils

kiki.utils.routing.create_message_commands(msg)

Given a message, creates and returns a list of commands for that message and target mailing lists.

kiki.utils.routing.list_post(list_cmd)

Given a kiki.models.ListCommand for a post, returns a kiki.models.ListMessage based on that command, or None if the command was invalid. The kiki.models.ListMessage will be marked either as “Accepted” or “Requires Moderation”, and it will have the appropriate list headers set.

kiki.utils.routing.prep_list_message(list_msg)

Runs kiki.utils.message.set_list_headers() on an accepted ListMessage and sets its status to ListMessage.PREPPED.

kiki.utils.routing.receive_email(msg_str)

Given a string representation of an email message, parses it into a KikiMessage. Returns a (message, created) tuple, where created is False if the message was already in the database.

kiki.utils.routing.send_list_message(list_msg, user)

Sends a copy of a kiki.models.ListMessage to a single User.

Project Versions

Table Of Contents

Previous topic

Celery tasks

Next topic

Email

This Page