Create new SSO users without sending welcome emails

I need to create several user accounts in order to import historical posts, and my forum uses SSO. Fortunately, I can automatically login and impersonate the user on my site and then make the necessary request to login to Discourse with SSO. However, I don’t want to trigger the welcome email for these users since they haven’t actually visited the forum themselves. (I just accidentally sent emails to ~300 users on my test Discourse. D:)

I noticed that all emails can be disabled, which I could do temporarily. It’s a little weird that it advertises the fact that emails are disabled to all users though. It’d also be really nice if the email could be triggered when the user actually visits, but I could live without that.

So:

  1. Can users be created with SSO using the API, and not the /session/sso route?
  2. If not, is there something like active=true I can use for SSO?

Thanks!

1 Like

That’s to avoid the issue where you forget that you disabled emails, and then launch the forum with that enabled :wink:

2 Likes

You could always hide this with CSS.

But be realistic how long will it really display… and will you forget to switch it off?

1 Like

I think it makes sense to show to admins, but does it make sense to show it to all users?

It does, as users might expect to get notification emails, signup emails, etc.

I need this functionality as well (suppressing emails when SSOing a user) - so I have created a pull request here: https://github.com/discourse/discourse/pull/3289

4 Likes

Merged in, be sure to update the wiki

1 Like