I don’t think they can. They would have to register and update their preferences on that topic or their overall notification preferences.
Are there some docs about this endpoint? I have searched API docs but it is not there.
I am looking for a way how to create topic and assign it to a specific user (by discourse-assign plugin).
And also thinking if API key have to by for user system or I can use some other user with minimal permissions (what are that minimal required?).
Just this post: Creating a staged user with an API call - #8 by blake
This is totally doable. Have a look at Reverse engineer the Discourse API and you will see which endpoint the discourse-assign plugin calls.
Nope does not need to be with the system user. You just need a user with enough trust level to create and assign topics.
Thank you for reply. I understand how to assign specific post, but how to reliably find post just created by the /admin/email/handle_mail endpoint? It also seems to queue received calls, so I will not always find it immediately after the first call.
Correct, that endpoint does not return a topic_id.
Do they HAVE to be staged users? Couldn’t you just create the user via the api and then create a topic? Or are people that don’t have accounts yet going to be emailing that endpoint?
It is for public contact form on different products where each have different merchant. I want to assign topic to the specific merchant and also deny access to topics what does not belong to that merchant.
J’ai une question du point de vue d’une personne non développeur.
J’utilise Discourse comme système de tickets pour notre entreprise et je l’ai configuré avec succès pour créer de nouveaux sujets à partir d’utilisateurs non enregistrés sur notre forum de support.
Parfois, j’ai besoin de créer un ticket pour un client au lieu qu’il le crée directement.
Existe-t-il une méthode simple, étape par étape, pour le faire et créer un sujet au nom de quelqu’un qui n’a pas encore de compte sur le forum ? Je ne veux pas qu’ils aient un compte complet, sauf s’ils s’en inscrivent un eux-mêmes.
J’essaierais de créer un sujet par e-mail entrant :
De cette façon, un utilisateur temporaire sera créé lors de la création du sujet.
Vous pourriez créer l’utilisateur temporaire via l’API
curl -i -sS -X POST "http://localhost:4200/users" \
-H "Content-Type: multipart/form-data" \
-H "Api-Key: 3e8aa0b7970cf010da24d06215fdc7b3951352c61a59ada70f5f36b4ce890bb2" \
-H "Api-Username: system" \
-F "name=2e6ac3603" \
-F "active=false" \
-F "staged=true" \
-F "username=2e6ac3603" \
-F "email=2e6ac3603@example.com" \
-F "password=f9b4c3c7ebd1c2877a0ad659be6ca83e"
puis créer le sujet pour l’utilisateur, mais lors de l’action de création d’utilisateur, Discourse enverra alors un e-mail d’activation :
{“success”: true,“active”: false,“message”: “Vous êtes presque prêt ! Nous avons envoyé un e-mail d'activation à 2e6ac3603@example.com. Veuillez suivre les instructions dans l'e-mail pour activer votre compte. S'il n'arrive pas, vérifiez votre dossier spam.”}
Donc, chacune de ces lignes est séparée par un CR à la fin ? Et y a-t-il un double espace, ou une tabulation avant chaque barre oblique inverse ?
Désolé, comme je l’ai dit, je ne suis pas un développeur, donc montrer ce code n’est pas suffisant pour m’aider sans un peu d’informations supplémentaires.
Donc, en utilisant cette méthode, on crée juste l’utilisateur, mais même si staged=true, il envoie l’e-mail d’invitation ?
La réponse la plus simple est toujours la meilleure :
Nous utiliserons donc cela pour nos besoins occasionnels.
Merci pour votre aide.