Let klirr email the invoice after generation with klirr invoice --email#13
Merged
Let klirr email the invoice after generation with klirr invoice --email#13
klirr invoice --email#13Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
- Coverage 97.40% 96.90% -0.50%
==========================================
Files 59 76 +17
Lines 1308 1648 +340
==========================================
+ Hits 1274 1597 +323
- Misses 34 51 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… rpassword for safer password input and README update about security.
klirr email test to testklirr invoice --email to test
klirr invoice --email to testklirr invoice --email
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds end-to-end support for emailing generated invoices via the klirr invoice --email flag.
- Introduce email settings submodels and persist encrypted SMTP credentials.
- Implement email composition and sending logic using the
lettrecrate. - Extend the CLI with
klirr emailcommands and integrate email into the invoice command.
Reviewed Changes
Copilot reviewed 50 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/core/src/models/valid_input.rs | Add optional email settings to ValidInput |
| crates/core/src/models/data/submodels/email/* | Define email submodels (settings, template, SMTP) |
| crates/core/src/logic/send_email.rs | Implement functions to send PDF invoices via email |
| crates/cli/src/input/get_input.rs | Add TUI prompts to configure and edit email settings |
| crates/cli/src/dispatch_command.rs | Wire new email commands into CLI dispatch |
| crates/cli/README.md | Document setup and usage of the email feature |
Comments suppressed due to low confidence (3)
crates/core/src/models/valid_input.rs:41
- [nitpick] The field
emailholds decrypted email settings; for clarity, consider renaming it toemail_settingsormaybe_email_settings.
email: Option<DecryptedEmailSettings>,
crates/core/src/logic/send_email.rs:1
- The new
send_email_with_settings_for_pdfandsend_email_with_credentialsfunctions lack direct unit tests; consider adding tests or mocks to cover the email-sending logic.
use crate::prelude::*;
crates/core/src/models/data/data_from_disk_with_items_of_kind.rs:98
- The
PathAndNamestruct is public but lacks a doc comment explaining its purpose; please add documentation for its fields and usage.
pub struct PathAndName {
klirr invoice --emailklirr invoice --email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New feature allowing you to automatically send an email with the invoice after it has been generated. Usage:
klirr invoice --email, which will prompt you for an encryption password which protects an SMTP App Password you generate with your email provider.Setup using:
klirr email initYou will be asked to input sender address, smtp server, smtp app password and an encryption password which protects the app password, and more. The smtp app password is saved in encrypted form and is encrypted by an encryption key derived (through HKDF) from the encryption password. Every time you send an email the encryption password will be prompted for. Or optionally you can set the encryption password as an ENV variable.