Skip to content

Commit

Permalink
Merge branch 'main' into ui-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwoberts committed Oct 10, 2024
2 parents 91bdc05 + 8d3bb29 commit 47c22de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 5 additions & 5 deletions app/handlers/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ func CreateTenant() web.HandlerFunc {
c.Enqueue(tasks.SendWelcomeEmail(user.Name, user.Email, siteURL))
}

// Handle userlist.
if env.Config.UserList.Enabled {
c.Enqueue(tasks.UserListCreateCompany(*createTenant.Result, *user))
}

return c.Ok(web.Map{})
}
}
Expand Down Expand Up @@ -190,11 +195,6 @@ func VerifySignUpKey() web.HandlerFunc {
return c.Failure(err)
}

// Handle userlist.
if env.Config.UserList.Enabled {
c.Enqueue(tasks.UserListCreateCompany(*c.Tenant(), *user))
}

webutil.AddAuthUserCookie(c, user)

c.Enqueue(tasks.SendWelcomeEmail(user.Name, user.Email, c.BaseURL()))
Expand Down
6 changes: 6 additions & 0 deletions app/handlers/signup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ func TestCreateTenantHandler_SingleHost_WithSocialAccount(t *testing.T) {
var newTenant *cmd.CreateTenant
bus.AddHandler(func(ctx context.Context, c *cmd.CreateTenant) error {
newTenant = c
newTenant.Result = &entity.Tenant{
ID: 1,
Name: c.Name,
Subdomain: c.Subdomain,
Status: enum.TenantActive,
}
return nil
})

Expand Down
4 changes: 2 additions & 2 deletions app/jobs/trial_reminder_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (e TrialReminderJobHandler) Run(ctx Context) error {
if len(to) > 0 {
bus.Publish(ctx, &cmd.SendMail{
From: dto.Recipient{
Name: "Guilherme from Fider",
Address: "goenning@fider.io",
Name: "Fider",
Address: "contact@fider.io",
},
To: to,
TemplateName: e.TemplateName,
Expand Down
4 changes: 2 additions & 2 deletions app/tasks/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func SendWelcomeEmail(name, email, baseURL string) worker.Task {

bus.Publish(c, &cmd.SendMail{
From: dto.Recipient{
Name: "Guilherme from Fider",
Address: "goenning@fider.io",
Name: "Fider",
Address: "contact@fider.io",
},
To: []dto.Recipient{to},
TemplateName: "welcome_email",
Expand Down

0 comments on commit 47c22de

Please sign in to comment.