fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail#1142
Conversation
There was a problem hiding this comment.
Pull Request Overview
Fixes a bug in the SendMail function where cc and bcc fields were not being set correctly due to incorrect conditional checks that referenced the email object's fields instead of the input parameters.
- Fixed conditional logic for setting
ccandbccfields in email sending - Changed condition checks from
e.Ccande.Bcctoccandbccinput parameters
|
|
||
| e.To = to | ||
| if len(e.Bcc) > 0 { | ||
| if len(bcc) > 0 { |
There was a problem hiding this comment.
The original condition if len(e.Bcc) > 0 was checking the length of an uninitialized field instead of the input parameter bcc. This fix correctly checks the input parameter length before assignment.
| e.Bcc = bcc | ||
| } | ||
| if len(e.Cc) > 0 { | ||
| if len(cc) > 0 { |
There was a problem hiding this comment.
The original condition if len(e.Cc) > 0 was checking the length of an uninitialized field instead of the input parameter cc. This fix correctly checks the input parameter length before assignment.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 99a6e88 | Previous: f9670e1 | Ratio |
|---|---|---|---|
Benchmark_DecryptString |
6848 ns/op 2032 B/op 16 allocs/op |
2123 ns/op 2032 B/op 16 allocs/op |
3.23 |
Benchmark_DecryptString - ns/op |
6848 ns/op |
2123 ns/op |
3.23 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1142 +/- ##
=======================================
Coverage 68.44% 68.44%
=======================================
Files 221 221
Lines 14319 14319
=======================================
Hits 9800 9800
Misses 4144 4144
Partials 375 375 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hwbrzzl
left a comment
There was a problem hiding this comment.
Good catch, could you also create a PR for v1.15.x?
|
📑 Description
Closes goravel/goravel#737
✅ Checks