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

fix(smtp): use param props from params arg #430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JosephKav
Copy link
Contributor

@JosephKav JosephKav commented Jan 19, 2024

was ignoring encryption, subject, fromname and fromaddress

Noticed from release-argus/Argus#352 - Setting fromname in param props that are given with sender.Send(toSend, params) was ignored.

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

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

Comparison is base (3c77fd5) 79.12% compared to head (795bb0a) 79.11%.

Files Patch % Lines
pkg/services/smtp/smtp.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
- Coverage   79.12%   79.11%   -0.01%     
==========================================
  Files         102      102              
  Lines        4488     4486       -2     
==========================================
- Hits         3551     3549       -2     
  Misses        758      758              
  Partials      179      179              

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

was ignoring encryption, subject, fromname and fromaddress
@@ -71,7 +71,7 @@ func (service *Service) Send(message string, params *types.Params) error {
return fail(FailApplySendParams, err)
}

client, err := getClientConnection(service.config)
client, err := getClientConnection(&config)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

	if useImplicitTLS(config.Encryption, config.Port) {
		conn, err = tls.Dial("tcp", addr, &tls.Config{
			ServerName: config.Host,
		})
	} else {
		conn, err = net.Dial("tcp", addr)
	}

This was ignoring the value in the params var

@@ -239,7 +237,7 @@ func (service *Service) getHeaders(toAddress string, subject string) map[string]
}

return map[string]string{
"Subject": subject,
"Subject": conf.Subject,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

conf.Subject may contain changes from the var

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.

1 participant