diff --git a/app/handlers/signup.go b/app/handlers/signup.go index 22de2ef5e..e6dcdcdb1 100644 --- a/app/handlers/signup.go +++ b/app/handlers/signup.go @@ -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{}) } } @@ -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())) diff --git a/app/handlers/signup_test.go b/app/handlers/signup_test.go index 191593ecd..e0a07540e 100644 --- a/app/handlers/signup_test.go +++ b/app/handlers/signup_test.go @@ -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 }) diff --git a/app/jobs/trial_reminder_job.go b/app/jobs/trial_reminder_job.go index 1e2fc9d15..fa5ce44a8 100644 --- a/app/jobs/trial_reminder_job.go +++ b/app/jobs/trial_reminder_job.go @@ -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, diff --git a/app/tasks/signup.go b/app/tasks/signup.go index 10eca8b7a..5b655896b 100644 --- a/app/tasks/signup.go +++ b/app/tasks/signup.go @@ -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",