Skip to content

Commit

Permalink
chore(deps): bump actions/setup-python from 4 to 5 (containrrr#427)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored and JosephKav committed Jan 19, 2024
1 parent be4df5e commit 63544c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
10 changes: 4 additions & 6 deletions pkg/services/smtp/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
if err != nil {
return fail(FailGetSMTPClient, err)
}
Expand Down Expand Up @@ -206,7 +206,7 @@ func (service *Service) sendToRecipient(client *smtp.Client, toAddress string, c
return fail(FailOpenDataStream, err)
}

if err := writeHeaders(wc, service.getHeaders(toAddress, config.Subject)); err != nil {
if err := writeHeaders(wc, service.getHeaders(toAddress, config)); err != nil {
return err
}

Expand All @@ -228,9 +228,7 @@ func (service *Service) sendToRecipient(client *smtp.Client, toAddress string, c
return nil
}

func (service *Service) getHeaders(toAddress string, subject string) map[string]string {
conf := service.config

func (service *Service) getHeaders(toAddress string, conf *Config) map[string]string {
var contentType string
if conf.UseHTML {
contentType = fmt.Sprintf(contentMultipart, service.multipartBoundary)
Expand All @@ -239,7 +237,7 @@ func (service *Service) getHeaders(toAddress string, subject string) map[string]
}

return map[string]string{
"Subject": subject,
"Subject": conf.Subject,
"Date": time.Now().Format(time.RFC1123Z),
"To": toAddress,
"From": fmt.Sprintf("%s <%s>", conf.FromName, conf.FromAddress),
Expand Down

0 comments on commit 63544c4

Please sign in to comment.