We have a feedback form on our website, which is mostly used for support questions. I want questions posted there to become new topics on our forum, powered by Discourse.
I am trying to implement the following sequence of actions:
Create a new user via API, based on the name and e-mail, submitted via the form.
Create a new topic, authored by this user.
Send this user an e-mail with the link to this topic, and also a request to create a password.
Now, I have found four e-mail templates on Discourse, that could be used in step 3 - âAccount createdâ, âLogin via linkâ, âForgot Passwordâ and âSet Passwordâ. In the API documentation, I only found a call that sends the âForgot Passwordâ message, but this doesnât seem to be the best candidate for my case.
My questions:
a) Under what circumstances other three messages (âAccount createdâ, âLogin via linkâ, and âSet Passwordâ) are sent?
b) How can I send them via API?
âaccount_createdâ is used when using the âinvite adminâ API endpoint, and when creating an administrator via the admin:invite rake task
âlogin via linkâ (internally referred to as email_login) is sent when someone uses the âlogin via emailâ link
âset passwordâ is the same as âforgot passwordâ, when the user does not already have a password in the database
I think the best approach is to create the new users as âstagedâ, and then send them an âinviteâ to the topic. That invite will log them straight into their staged account, and then take them to the topic. They wonât be asked to create a password, but they can do that manually, or just use the sign in via email option.