feat: Add "Send Invitation Email" action to User Invitation flow (#4113)

This commit is contained in:
DacongDA
2025-08-21 18:53:43 +08:00
committed by GitHub
parent f7bc822087
commit a23033758f
68 changed files with 424 additions and 29 deletions

View File

@@ -30,7 +30,7 @@ func TestSmtpServer(provider *Provider) error {
return nil
}
func SendEmail(provider *Provider, title string, content string, dest string, sender string) error {
func SendEmail(provider *Provider, title string, content string, dest []string, sender string) error {
emailProvider := email.GetEmailProvider(provider.Type, provider.ClientId, provider.ClientSecret, provider.Host, provider.Port, provider.DisableSsl, provider.Endpoint, provider.Method, provider.HttpHeaders, provider.UserMapping, provider.IssuerUrl)
fromAddress := provider.ClientId2

View File

@@ -235,3 +235,8 @@ func (invitation *Invitation) IsInvitationCodeValid(application *Application, in
}
return true, ""
}
func (invitation *Invitation) GetInvitationLink(host string, application string) string {
frontEnd, _ := getOriginFromHost(host)
return fmt.Sprintf("%s/signup/%s?invitationCode=%s", frontEnd, application, invitation.Code)
}

View File

@@ -129,7 +129,7 @@ func SendVerificationCodeToEmail(organization *Organization, user *User, provide
return err
}
err = SendEmail(provider, title, content, dest, sender)
err = SendEmail(provider, title, content, []string{dest}, sender)
if err != nil {
return err
}