Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Charset support for message parts #172

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

wneessen
Copy link
Owner

Charset support has been added in the 'Part' struct. A 'SetCharset' method and a 'WithPartCharset' option have been added to override the default Part charset. The 'writePart' function in msgWriter now accommodates the charset defined at the Part level, defaulting to the previous functionality if not set.

This closes #171

Charset support has been added in the 'Part' struct. A 'SetCharset' method and a 'WithPartCharset' option have been added to override the default Part charset. The 'writePart' function in msgWriter now accommodates the charset defined at the Part level, defaulting to the previous functionality if not set.
@wneessen wneessen linked an issue Jan 31, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (7dced4b) 81.45% compared to head (ef86a1a) 80.98%.

❗ Current head ef86a1a differs from pull request most recent head 2f60d9c. Consider uploading reports for the commit 2f60d9c to get more accurate results

Files Patch % Lines
part.go 0.00% 6 Missing ⚠️
msgwriter.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #172      +/-   ##
==========================================
- Coverage   81.45%   80.98%   -0.47%     
==========================================
  Files          24       24              
  Lines        2114     2125      +11     
==========================================
- Hits         1722     1721       -1     
- Misses        279      289      +10     
- Partials      113      115       +2     

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

New unit tests have been introduced for WithPartCharset and SetCharset methods in part_test.go. Also, a GetCharset method has been implemented in part.go. These modifications ensure the robustness of charset handling within the application.
The code has been updated to allow for an HTML alternative to the plain text body in messages. This includes adding a new function to add this alternative body along with additional unit tests to ensure the multipart messages are properly constructed. The tests also check the correct usage of different charsets.
@wneessen wneessen merged commit 64a0739 into main Feb 5, 2024
24 checks passed
@wneessen wneessen deleted the feature/171_implement-per-part-charsets branch February 5, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement per-part charsets
1 participant