Create new SSO users without sending welcome emails


(Ryan Fox) #1

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!


(Kane York) #2

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


(Dean Taylor) #3

You could always hide this with CSS.

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


(Ryan Fox) #4

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


(Jeff Atwood) #5

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


#6

I need this functionality as well (suppressing emails when SSOing a user) - so I have created a pull request here: Add an sso option to suppress welcome emails by dansingerman · Pull Request #3289 · discourse/discourse · GitHub


(Sam Saffron) #7

Merged in, be sure to update the wiki