summaryrefslogtreecommitdiff
path: root/postgresqleu/mailqueue/util.py
AgeCommit message (Collapse)Author
2024-05-14Add ability to low-level queue emails in the futureMagnus Hagander
Most of the system won't be using this, but it's still good to have for completeness sake.
2023-06-01Teach mailqueue viewer to show attachments in pending emailsMagnus Hagander
2020-03-25Set flags indicating our outbound emails are auto-submittedMagnus Hagander
Since all of our emails are, set it for all emails for now, but keep flags around to make it possible to change in the future. Hoepfully these headers will help decrease then number of out-of-office emails received when sending things out.
2019-04-06Make the mail queue managable through the backend interfaceMagnus Hagander
This adds a viewer and editor for the mailqueue to the dashboard, superuser only. While at it, expose time and subject directly in the queue to make it easier to determine what is what. Most of the time this is not going to matter because emails are short-lived in the queue. But during development and definitely during debugging, it can be quite useful. Move the "parsed mail view" out of django admin and into the backend view so we don't have to maintain it twice. There is very little use for the admin view anymore, so it's OK to just show the raw data there.
2019-03-16Fix mail sending with BCCsMagnus Hagander
Looks like this was broken in the python 3 migration, but missed since it only affected cases where a single address was added, and not a list of addresses. The only user of this was data-purge warnings.
2019-01-10Manual import fixesMagnus Hagander
2019-01-04Fix sibling importsMagnus Hagander
Sibling imports should be prefixed with a period. Good idea in py2, will eventually become required in py3, so another small step.
2018-12-19Add ability to add extra bcc addresses to invoicesMagnus Hagander
This can be a list (comma separated) of email addresses that will receive a BCC of all emails about this invoice. This is similar to how the treasurer address gets such a copy, but makes it possible to add more than one address.
2018-12-14Fix blankline related warningsMagnus Hagander
2018-12-14Fix spaces before/after comma and colonMagnus Hagander
Mostly not important, but getting rid of the PIP warnings will help catch errors in the future.
2018-12-14Fix spacing around parameter namesMagnus Hagander
Surprisingly many of these were pure copy/paste errors from the same source...
2018-12-14Replace tabs with spacesMagnus Hagander
In an effort to close up with PEP8, we should use spaces for indent rather than tabs... Time to update your editor config!
2018-03-23template.render() should not use a context, just a dictMagnus Hagander
2017-05-30Properly format email headers with non-asciiMagnus Hagander
When sending an email to non-ascii names, the actual email address should not be part of the encoded section. It should have a separate section that's not encoded.
2017-04-17Introduce send_template_mailStephen Frost
This introduces the function of the same name from the pgweb code base (though it isn't identical, to be clear). This function is to be used when rendering a text file into an email. There is a helper function template_to_string() which is also added and can be used if a string result is needed. The primary different here is that the variables set in util/context_processor:settings_context are included in the hash automatically, so those settings do not need to be explicitly set by the callers and the templates can expect them to be available. Using that, this change also includes changes to move away from hard-coded values like 'PostgreSQL Europe' in favor of using the variables set in settings.py/local_settings.py in the text templates. This will allow others to re-use the exisitng templates and not have to develop and maintain their own going forward.
2015-02-09Set sender and recipient name on outgoing emailsMagnus Hagander
Instead of just using bare headers. Hopefully this will lower some spamscores, and more importantly make things actually look better to receipients. In passing, fix ability to use unicode characters in subjects.
2014-07-08BCC invoice emails to treasurer@Magnus Hagander
This will BCC all manual invoice emails only. This is basically all the emails generated except receipts that are generated for invoices that have a processor set.
2013-08-14Prevent double base64-encoding of PDFs. Oops.Magnus Hagander
2013-08-13Avoid duplicate encoding headersMagnus Hagander
2013-08-13Ensure correct encoding of MIME attachmentsMagnus Hagander
2013-06-29Send manual confreg emails using the new mail queue systemMagnus Hagander
Makes it behave much nicer when there are issues sending, and doesn't end up calling out to SMTP from within a regular web request.
2013-04-19Add a simple mail queue in the databaseMagnus Hagander
Adds a function to call that will render a complete MIME message, and write the resulting text to a database table. Then there is a cron job that runs at regular intervals (every 5 mins or so) and sends all the queued emails. This brings in two important functions: * The ability to "send" emails from regular web views without the risk of ending up blocking on the SMTP server. * The abilitty to "transactionally send email" - meaning that mail sen this way will just disappear if the transaction (normally managed by django) that's open when it was sent ends up rolling back. This prevents re-sending email over and over again when some later step in the process fails.