Skip to content

fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail (v1.15.x)#1143

Merged
krishankumar01 merged 1 commit intov1.15.xfrom
kkumar-gcc/mail-fix-v1.15.x
Jul 25, 2025
Merged

fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail (v1.15.x)#1143
krishankumar01 merged 1 commit intov1.15.xfrom
kkumar-gcc/mail-fix-v1.15.x

Conversation

@krishankumar01
Copy link
Member

📑 Description

Closes https://github.com/goravel/goravel/issues/

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings July 25, 2025 14:17
@krishankumar01 krishankumar01 requested a review from a team as a code owner July 25, 2025 14:17
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

This PR fixes a bug in the SendMail function where cc and bcc fields were not being set correctly due to incorrect condition checks. The issue was that the code was checking the length of the email struct's fields (e.Bcc and e.Cc) instead of the input parameters.

  • Fixed condition checks to use input parameters instead of uninitialized struct fields
  • Ensures cc and bcc fields are properly set when provided


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 fix correctly addresses the logic error. Previously, e.Bcc would always be empty at this point since it hasn't been assigned yet, so the condition len(e.Bcc) > 0 would never be true, preventing the bcc parameter from being assigned.

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 fix correctly addresses the logic error. Previously, e.Cc would always be empty at this point since it hasn't been assigned yet, so the condition len(e.Cc) > 0 would never be true, preventing the cc parameter from being assigned.

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: 0d891dc Previous: f9670e1 Ratio
Benchmark_DecryptString 6703 ns/op 2040 B/op 17 allocs/op 2123 ns/op 2032 B/op 16 allocs/op 3.16
Benchmark_DecryptString - ns/op 6703 ns/op 2123 ns/op 3.16

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.

Please upload report for BASE (v1.15.x@c0d3ce6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
mail/application.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v1.15.x    #1143   +/-   ##
==========================================
  Coverage           ?   68.77%           
==========================================
  Files              ?      219           
  Lines              ?    18873           
  Branches           ?        0           
==========================================
  Hits               ?    12979           
  Misses             ?     5233           
  Partials           ?      661           

☔ 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.

@krishankumar01 krishankumar01 merged commit 286bbcb into v1.15.x Jul 25, 2025
11 of 12 checks passed
@krishankumar01 krishankumar01 deleted the kkumar-gcc/mail-fix-v1.15.x branch July 25, 2025 14:27
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.

3 participants