• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 15618414823 / 2
81%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-1452-new_action
DEFAULT BRANCH: master
Ran 12 Jun 2025 07:16PM UTC
Files 653
Run time 194min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jun 2025 06:37PM UTC coverage: 81.032% (-0.03%) from 81.058%
15618414823.2

push

github

web-flow
feat(massEmails): preview query results DEV-478 (#5841)


### đŸ“Ŗ Summary
Allow users to download a list of expected recipients of a mass email
based on the query used.


### 📖 Description
Creates ExportJobs for MassEmailConfigs that will have details about the
expected recipients for the emails. Once requested, the user will
receive an email when the job is done and be able to download the list
from Django admin.


### 💭 Notes
Uses the existing django-import-export-celery framework even though it's
more meant for exporting lists of models rather than this kind of
byproduct of a model. However, the framework is already there and allows
multiple formats as well as handling the email portion, and the tweaks
necessary to make it work for a list of users rather than a list of
configs are pretty slight (just doing some work in the `after_export`
hook).
If there are no recipients, the process will just return an empty csv
(only headers). This is not ideal, but there is not an easy way to tell
the user that no recipients were found using just the library. The job
status would be the most obvious place to put this kind of information,
but is part of the ExportJob object which we don't have access to in any
of the export methods. We could run the query first before creating the
export job and use the usual admin error alerts if the query returns
empty, but the query could take a long time and this would defeat the
purpose of doing all the work in the background.


### 👀 Preview steps
Run mailhog or file-backed email for easier testing.

1. â„šī¸ have a superuser account and at least one other
2. In Django admin, update MASS_EMAIL_TEST_EMAILS in Constance with at
least 2 user emails
3. In Django admin, create a MassEmailConfig that uses the 'test_users'
query. Frequency/live doesn't matter here.
4. On the list of MassEmailConfigs, select your new configuration.
5. đŸŸĸ There should be an "Export with celery" action
6. Trigger the export
7. You will be taken to a prefil... (continued)

6328 of 10009 branches covered (63.22%)

23954 of 29561 relevant lines covered (81.03%)

0.81 hits per line

Source Files on job 15618414823.2
  • Tree
  • List 653
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 15618414823
  • 73adc79b on github
  • Prev Job for on main (#15616370692.2)
  • Next Job for on main (#15687580355.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc