Skip to content

Comments

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

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

fix: cc and bcc fields not set when sending mail due to incorrect condition in SendMail (v1.16.x)#1144
krishankumar01 merged 1 commit intov1.16.xfrom
kkumar-gcc/mail-fix-v1.16.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:23
@krishankumar01 krishankumar01 requested a review from a team as a code owner July 25, 2025 14:23
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 conditional checks. The issue was that the code was checking the length of the email struct's CC/BCC fields instead of the input parameters.

  • Fixed conditional checks for CC and BCC field assignment to use input parameters instead of email struct fields
  • Ensures CC and BCC recipients are properly included when sending emails


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 bug where the condition was checking len(e.Bcc) instead of len(bcc). Since e.Bcc would be empty at this point, the condition would never be true, preventing BCC recipients from being set.

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 bug where the condition was checking len(e.Cc) instead of len(cc). Since e.Cc would be empty at this point, the condition would never be true, preventing CC recipients from being set.

Copilot uses AI. Check for mistakes.
@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 66.83%. Comparing base (46568ee) to head (368f135).

Files with missing lines Patch % Lines
mail/application.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           v1.16.x    #1144   +/-   ##
========================================
  Coverage    66.83%   66.83%           
========================================
  Files          215      215           
  Lines        14071    14071           
========================================
  Hits          9404     9404           
  Misses        4291     4291           
  Partials       376      376           

☔ 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

@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: 368f135 Previous: f9670e1 Ratio
Benchmark_DecryptString 6457 ns/op 2032 B/op 16 allocs/op 2123 ns/op 2032 B/op 16 allocs/op 3.04
Benchmark_DecryptString - ns/op 6457 ns/op 2123 ns/op 3.04

This comment was automatically generated by workflow using github-action-benchmark.

@krishankumar01 krishankumar01 merged commit 6580bba into v1.16.x Jul 25, 2025
13 of 15 checks passed
@krishankumar01 krishankumar01 deleted the kkumar-gcc/mail-fix-v1.16.x branch July 25, 2025 14:29
hwbrzzl added a commit that referenced this pull request Sep 19, 2025
* correctly set cc and bcc headers (#1144)

* correct the error return from SendMailJob handle (#1147)

* fix: [#743] package make command generates correct code (#1151) (#1152)

(cherry picked from commit 93dc8a3)

* fix: [#749] The path is incorrect when publishing package files (#1157)

* chore: optimize assertions for package installation (#1160)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting (#1162)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting

* optimize

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method (#1166)

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method

* fix tests

* upgrade: v1.16.1

* fix: [#762] handle panic when using transaction (#1183)

* fix: [#762] handle panic when using transaction

* v1.16.2

* optimize

* fix lint

* fix: [#768] facades.DB will panic when migrating a new column (#1185)

* fix: [#768] facades.DB will panic when migrating a new column

* optimize

* optimize

* feat: [#770] Add a SelectRaw function for the ORM (#1186)

* fix: [#770] Add a SelectRaw function for the ORM

* fix: [#770] Add a SelectRaw function for the ORM

* fix ci

* upgrade: v1.16.3

* fix typo

---------

Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: ALMAS <almas.cc@icloud.com>
hwbrzzl added a commit that referenced this pull request Oct 26, 2025
* correctly set cc and bcc headers (#1144)

* correct the error return from SendMailJob handle (#1147)

* fix: [#743] package make command generates correct code (#1151) (#1152)

(cherry picked from commit 93dc8a3)

* fix: [#749] The path is incorrect when publishing package files (#1157)

* chore: optimize assertions for package installation (#1160)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting (#1162)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting

* optimize

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method (#1166)

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method

* fix tests

* upgrade: v1.16.1

* fix: [#762] handle panic when using transaction (#1183)

* fix: [#762] handle panic when using transaction

* v1.16.2

* optimize

* fix lint

* fix: [#768] facades.DB will panic when migrating a new column (#1185)

* fix: [#768] facades.DB will panic when migrating a new column

* optimize

* optimize

* feat: [#770] Add a SelectRaw function for the ORM (#1186)

* fix: [#770] Add a SelectRaw function for the ORM

* fix: [#770] Add a SelectRaw function for the ORM

* fix ci

* upgrade: v1.16.3

* fix: comand cannot be run concurrently (#1243)

* fix: comand cannot be run concurrently

* fix ci

* fix ci

* optimize

* optimize

* optimize

* optimize

* optimize global options

* fix ci

* upgrade v1.16.4

* optimize

* optimize

---------

Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: ALMAS <almas.cc@icloud.com>
hwbrzzl added a commit that referenced this pull request Oct 31, 2025
* correctly set cc and bcc headers (#1144)

* correct the error return from SendMailJob handle (#1147)

* fix: [#743] package make command generates correct code (#1151) (#1152)

(cherry picked from commit 93dc8a3)

* fix: [#749] The path is incorrect when publishing package files (#1157)

* chore: optimize assertions for package installation (#1160)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting (#1162)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting

* optimize

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method (#1166)

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method

* fix tests

* upgrade: v1.16.1

* fix: [#762] handle panic when using transaction (#1183)

* fix: [#762] handle panic when using transaction

* v1.16.2

* optimize

* fix lint

* fix: [#768] facades.DB will panic when migrating a new column (#1185)

* fix: [#768] facades.DB will panic when migrating a new column

* optimize

* optimize

* feat: [#770] Add a SelectRaw function for the ORM (#1186)

* fix: [#770] Add a SelectRaw function for the ORM

* fix: [#770] Add a SelectRaw function for the ORM

* fix ci

* upgrade: v1.16.3

* fix: comand cannot be run concurrently (#1243)

* fix: comand cannot be run concurrently

* fix ci

* fix ci

* optimize

* optimize

* optimize

* optimize

* optimize global options

* fix ci

* upgrade v1.16.4

* fix: [#807] queue.Shutdown doesn't stop the queue as expected (#1252)

* fix: [#807] queue.Shutdown doesn't stop the queue as expected

* optimize

* upgrade: v1.16.5

* fix

* Update queue/worker_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* optimize

---------

Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: ALMAS <almas.cc@icloud.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hwbrzzl added a commit that referenced this pull request Oct 31, 2025
* correctly set cc and bcc headers (#1144)

* correct the error return from SendMailJob handle (#1147)

* fix: [#743] package make command generates correct code (#1151) (#1152)

(cherry picked from commit 93dc8a3)

* fix: [#749] The path is incorrect when publishing package files (#1157)

* chore: optimize assertions for package installation (#1160)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting (#1162)

* fix: The configuredServiceProviders, publishes and publishGroups are not reset when Booting

* optimize

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method (#1166)

* fix: [#738] The Orm Creating event can be triggered when the query with the Model method

* fix tests

* upgrade: v1.16.1

* fix: [#762] handle panic when using transaction (#1183)

* fix: [#762] handle panic when using transaction

* v1.16.2

* optimize

* fix lint

* fix: [#768] facades.DB will panic when migrating a new column (#1185)

* fix: [#768] facades.DB will panic when migrating a new column

* optimize

* optimize

* feat: [#770] Add a SelectRaw function for the ORM (#1186)

* fix: [#770] Add a SelectRaw function for the ORM

* fix: [#770] Add a SelectRaw function for the ORM

* fix ci

* upgrade: v1.16.3

* fix: comand cannot be run concurrently (#1243)

* fix: comand cannot be run concurrently

* fix ci

* fix ci

* optimize

* optimize

* optimize

* optimize

* optimize global options

* fix ci

* upgrade v1.16.4

* fix: [#807] queue.Shutdown doesn't stop the queue as expected (#1252)

* fix: [#807] queue.Shutdown doesn't stop the queue as expected

* optimize

* upgrade: v1.16.5

* fix

* Update queue/worker_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* optimize

---------

Co-authored-by: krishan kumar <84431594+kkumar-gcc@users.noreply.github.com>
Co-authored-by: ALMAS <almas.cc@icloud.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants