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

231120 release to main (v3.1.2) #214

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/mail/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func MakeVerityIdentityMessage(to, code string) (*MessageInfo, error) {
return m, nil
}

func MakeTemporaryPasswordMessage(to, randomPassword string) (*MessageInfo, error) {
func MakeTemporaryPasswordMessage(to, organizationId, accountId, randomPassword string) (*MessageInfo, error) {
subject := "[TKS] 임시 비밀번호가 발급되었습니다."

tmpl, err := template.ParseFS(templateFS, "contents/temporary_password.html")
Expand All @@ -43,7 +43,7 @@ func MakeTemporaryPasswordMessage(to, randomPassword string) (*MessageInfo, erro
return nil, err
}

data := map[string]string{"TemporaryPassword": randomPassword}
data := map[string]string{"TemporaryPassword": randomPassword, "OrganizationId": organizationId, "AccountId": accountId}

var tpl bytes.Buffer
if err := tmpl.Execute(&tpl, data); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions internal/mail/contents/temporary_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<tr>
<td height="60" colspan="3"></td>
</tr>
<tr>
<td colspan="3" style="font-family: Malgun Gothic, '맑은고딕';letter-spacing:-0.02em;font-size:21px;font-weight:bold;color:#000;line-height:1.29;">조직 코드: {{.OrganizationId}}</td>
</tr>
<tr>
<td colspan="3" style="font-family: Malgun Gothic, '맑은고딕';letter-spacing:-0.02em;font-size:21px;font-weight:bold;color:#000;line-height:1.29;">아이디: {{.AccountId}}</td>
</tr>
<tr>
<td colspan="3" style="font-family: Malgun Gothic, '맑은고딕';letter-spacing:-0.02em;font-size:21px;font-weight:bold;color:#000;line-height:1.29;">임시 비밀번호</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion internal/usecase/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (u *AuthUsecase) FindPassword(code string, accountId string, email string,
return httpErrors.NewInternalServerError(err, "", "")
}

message, err := mail.MakeTemporaryPasswordMessage(email, randomPassword)
message, err := mail.MakeTemporaryPasswordMessage(email, organizationId, accountId, randomPassword)
if err != nil {
log.Errorf("mail.MakeVerityIdentityMessage error. %v", err)
return httpErrors.NewInternalServerError(err, "", "")
Expand Down
2 changes: 1 addition & 1 deletion internal/usecase/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (u *UserUsecase) ResetPassword(userId uuid.UUID) error {
return httpErrors.NewInternalServerError(err, "", "")
}

message, err := mail.MakeTemporaryPasswordMessage(user.Email, randomPassword)
message, err := mail.MakeTemporaryPasswordMessage(user.Email, user.Organization.ID, user.AccountId, randomPassword)
if err != nil {
log.Errorf("mail.MakeVerityIdentityMessage error. %v", err)
return httpErrors.NewInternalServerError(err, "", "")
Expand Down
Loading