summaryrefslogtreecommitdiff
path: root/postgresqleu/mailqueue
AgeCommit message (Collapse)Author
2024-10-08Decorate mailqueue views with @login_requiredMagnus Hagander
We did explicitly check for superuser permissions, so there was no way to get in, but without the decorator we wouldn't get the redirect to the login page.
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.
2024-05-14Track regtime separate from sendtime on queued emailsMagnus Hagander
The regtime is always set to the extact time that an email was added. If a different sendtime is specified, it's still good to be able to track when something was added to the queue.
2024-05-14Complete the sendtime handling for mailqueueMagnus Hagander
Sync up the "warning button" filtering with that of the alerts, which means we don̈́'t alert for emails that aren't supposed to be sent yet. This becomes more relevant as we also stop trying to send emails that are set to be sent in the future, in preparation for upcoming functionality to schedule email sending.
2023-06-01Teach mailqueue viewer to show attachments in pending emailsMagnus Hagander
2022-11-05Make mail queue detailed view fields read-onlyMagnus Hagander
Also remove the save button since there is nothing to save, but keep the delete button since we still want the ability to clear the queue.
2022-11-05Add subject to full message in mail queue viewMagnus Hagander
2021-12-27Revert "Silence warnings from send_queued_mail on django 3.2"Magnus Hagander
This reverts commit d38c7e5237073e41abae530c4f93d0d3a976f681, as it is no longer needed now that we have moved to the in-core JSONField.
2021-12-23Silence warnings from send_queued_mail on django 3.2Magnus Hagander
Silence the deprecation warnings that otherwise happens on Django 3.2 about the deprecation of JSONField. This can be reverted once the full migration to 3.2 is done, but since this is a cronjob that usually runs every minute or two it generates an insane amount of warnings until that point, so just shut it up.
2020-07-13Remove unused importsMagnus 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.
2020-02-20Make it possible to configure the outgoing SMTP serverMagnus Hagander
Default is still going to be localhost on the default port, but it's now possible to override this in local_settings.py by setting the value for SMTPSERVER.
2019-10-29Fix default ordering of mailqueue tableMagnus Hagander
Normally this doesn't matter as all data in the table is very short-lived, but it's ueful when debugging.
2019-07-09Make email forms use monospace font and fixed widthMagnus Hagander
To make it easier to write plaintext emails, make sure the font used for the email body is monospace, and do hard auto-wrapping at 72 characters. In passing also make a couple of other fields like PEM keys for Trustly use a monospace font (but of course not hard wrapping).
2019-04-06Add basic documentation for email moduleMagnus Hagander
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-10Replace __unicode__ with __str__Magnus Hagander
2to3 doesn't do this automatically, probably because weird things can happen if you had both. We know we didn't, so just do a straight replacement.
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.
2019-01-04Switch to new style try/except handlingMagnus Hagander
Python 2.6 introduced the better syntax, Python 3 removes the old one, so one small step towards py3.
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-14Avoid multi-statement rowsMagnus Hagander
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-06-29Fix incorrect exception namesMagnus Hagander
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.
2016-09-30Attempt to decode emails in hte queueMagnus Hagander
We only do very simple decoding, but even at this level it helps a lot with debugging messages going out of the system.
2016-01-08Add django migrations for all applicationsMagnus Hagander
This replaces our old custom migrations. NOTE! Since there are some dependencies in these migrations, they need to be individually faked. Since we want the django core apps to get upgraded anyway, the commands that need to be run are: python manage.py migrate auth --fake-initial python manage.py migrate admin --fake-initial python manage.py migrate contenttypes --fake-initial python manage.py migrate --fake Note: braintreepayments app not yet migrated
2016-01-08Move send_queued_mail script to be internal commandMagnus Hagander
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.
2014-01-01Clean up unused importsMagnus Hagander
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.