Skip to content

Comments

fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail#1142

Merged
krishankumar01 merged 1 commit intomasterfrom
kkumar-gcc/mail-fix
Jul 25, 2025
Merged

fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail#1142
krishankumar01 merged 1 commit intomasterfrom
kkumar-gcc/mail-fix

Conversation

@krishankumar01
Copy link
Member

📑 Description

Closes goravel/goravel#737

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings July 25, 2025 13:40
@krishankumar01 krishankumar01 requested a review from a team as a code owner July 25, 2025 13:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 cc and bcc fields in email sending
  • Changed condition checks from e.Cc and e.Bcc to cc and bcc input parameters


e.To = to
if len(e.Bcc) > 0 {
if len(bcc) > 0 {
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
e.Bcc = bcc
}
if len(e.Cc) > 0 {
if len(cc) > 0 {
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 68.44%. Comparing base (f9670e1) to head (99a6e88).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
mail/application.go 0.00% 2 Missing ⚠️
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.
📢 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.

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, could you also create a PR for v1.15.x?

@krishankumar01
Copy link
Member Author

krishankumar01 commented Jul 25, 2025

Good catch, could you also create a PR for v1.15.x?

#1143

@krishankumar01 krishankumar01 merged commit a5e38a6 into master Jul 25, 2025
13 of 15 checks passed
@krishankumar01 krishankumar01 deleted the kkumar-gcc/mail-fix branch July 25, 2025 14:32
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.

cc and bcc fields not set when sending mail due to incorrect condition in SendMail

2 participants