Skip to content

feat: more mail sending backends and plugability - #9608

Merged
SchrodingersGat merged 96 commits into
inventree:masterfrom
matmair:matmair/issue7950
Jun 20, 2025
Merged

SchrodingersGat merged 96 commits into
inventree:masterfrom
matmair:matmair/issue7950

Conversation

@matmair

@matmair matmair commented Apr 30, 2025 •

Copy link
Copy Markdown
Member

This introduces models to track mail delivery and receiving - and mail processing.

Todo:

  • Mail receiving
  • Passing received mails to plugins
  • Passing outgoing mails to plugins
  • Admin UI to view mails
  • email doc improvements
  • maybe: send test mail
  • mixin docs

Closes #7950
Closes #7951

I have validated sending against:

  • SMTP with cpanel
  • SMTP with Postfix
  • Sending / receiving with Mailgun
  • NOT - avoid them! - Sending / receiving with Sendgrid
  • Sending with Mailjet

I have validated receiving againsz:

  • Mailgun
  • Mailjet

@netlify

netlify Bot commented Apr 30, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 9de51be
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6854b131f4fc6c0008c11e88
😎 Deploy Preview https://deploy-preview-9608--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 1 from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@matmair matmair changed the title Matmair/issue7950 feat: Better Mail Methods Apr 30, 2025
@matmair
matmair marked this pull request as draft April 30, 2025 16:47
@matmair matmair self-assigned this Apr 30, 2025
@matmair matmair added enhancement This is an suggested enhancement or new feature api Relates to the API feature User Interface Related to the frontend / User Interface labels Apr 30, 2025
@matmair matmair added this to the 1.0.0 milestone Apr 30, 2025
@codecov

codecov Bot commented Apr 30, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.67%. Comparing base (797b5f5) to head (9de51be).
⚠️ Report is 318 commits behind head on master.

Files with missing lines Patch % Lines
src/backend/InvenTree/plugin/base/mail/mail.py 75.75% 8 Missing ⚠️
src/backend/InvenTree/InvenTree/helpers_email.py 40.00% 6 Missing ⚠️
src/backend/InvenTree/InvenTree/middleware.py 50.00% 2 Missing ⚠️
src/backend/InvenTree/InvenTree/settings.py 80.00% 1 Missing ⚠️
src/backend/InvenTree/plugin/base/mail/mixins.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9608      +/-   ##
==========================================
- Coverage   86.47%   85.67%   -0.80%     
==========================================
  Files        1236     1242       +6     
  Lines       54285    55879    +1594     
  Branches     2234     2236       +2     
==========================================
+ Hits        46944    47877     +933     
- Misses       6773     7434     +661     
  Partials      568      568              
Flag Coverage Δ
backend 88.51% <95.80%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matmair matmair changed the title feat: Better Mail Methods feat: more mail sending backends and plugability Jun 10, 2025
@matmair

matmair commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

Only missing mixin docs; would be ready for a first round of review @SchrodingersGat

@matmair
matmair marked this pull request as ready for review June 16, 2025 20:19
@matmair

matmair commented Jun 19, 2025

Copy link
Copy Markdown
Member Author

Docs are added now, ready to go

@SchrodingersGat

Copy link
Copy Markdown
Member

@matmair this looks quite comprehensive! Will the existing mail setups still work after this change?

@matmair

matmair commented Jun 20, 2025 •

Copy link
Copy Markdown
Member Author

@SchrodingersGat no changes to default mail setup, just a bit more database logic in the backend to track outgoing and incoming mails.

This is the most important point, settings are still the same

EMAIL_BACKEND = 'InvenTree.backends.InvenTreeMailLoggingBackend'
INTERNAL_EMAIL_BACKEND = get_setting(

@SchrodingersGat SchrodingersGat added the migration Data or schema migrations label Jun 20, 2025
@SchrodingersGat

Copy link
Copy Markdown
Member

Thanks for implementing this :)

@SchrodingersGat
SchrodingersGat merged commit 45daef8 into inventree:master Jun 20, 2025
@SchrodingersGat
SchrodingersGat deleted the matmair/issue7950 branch June 20, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API enhancement This is an suggested enhancement or new feature feature migration Data or schema migrations User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Add support for incoming email for plugins [FR] Improve Email handeling

2 participants