Automate sending Discourse invite emails with Zapier

Ah, awesome info. Thanks!!

1 Like

Thanks for the great tutorial! Is there a way to add a topic id that the user gets redirected to after signing up like in the bulk invite feature?

It is possible to invite a new user to a topic with a similar approach to what is outlined above, but the URL that you setup in the Action step needs to point to the topic. For example, to invite a user to a topic with the id 123 you would add the URL https://forum.example.com/t/123/invite to the Action step. You would then add the email and the optional custom_message and group_names parameters in the same way as they are outlined in the guide.

2 Likes

Hi Simon,

Thanks for your post !

I have 2 questions, if you could help me, it could be awesome :slight_smile:

Question 1/
On my side, the invite + message is working fine, but whatever group_names I’m adding, I only have access to the default public group, when I join the forum.

Do you know is something could “block” the invite to specific private group ?

The URL of the group name is like that : https://forum.[mywebsite].com/c/cercle/33

So I have : group_names /// PUBLIC,cercle

I also tried to use “number” instead of the group name (33) for this group, but it still doesn’t work.

Maybe there is a kind of “restriction” on the admin setting of the forum, which block the private group invite ?

Question 2/

I would like to be able to invite people, not only to “private group”, but "private “sub-group” (I don’t know the right name for that)

Screenshot 2021-05-12 at 08.04.11

Here you can see, I have the group “RÉSERVÉ…”
And all the little sub-groups under it.

I would like to invite users to specific subgroups.

Do you know how I can do that ?

Thanks a lot if you can take some time to help me on that ! :slight_smile:

1 Like

Make sure that you are using the group’s name and not the name of the category that you allow the group to access. You can find the group’s name in the URL for the group, or from the group’s Name field:

If that does not resolve the issue, make sure that the Discourse API key you add to Zapier is a global All Users API key. Also, make sure that the API Username set on Zapier has permission to add users to the group. Any admin username on your site will work for this.

Let me know if this doesn’t resolve the issue for you.

You can invite the user to multiple groups by adding a comma separated list of group names to the group_names field on Zapier. Discoure doesn’t have the concept of sub-groups, so you will need to add the name of each group you want to invite the user to.

From the screenshot you have provided, it looks like you are trying to give the user access to a category and all of its subcategories. Instead of creating a group for each subcategory you could just allow a single group to access the category and all of its subcategories. This is configured on the Security section of the category’s edit page.

2 Likes

Thanks for your reply Simon !

So, regarding the API :

I had give the access to only one user (the admin) I thought it was ok. So now I created a new API to give access to all user.

But, it still didn’t work. But I may have understood the issue :slight_smile:

I’m trying to add a “category” name, in the “group_names” field. So I guess it can’t work :).

I misunderstood the name of groups/category/topic…

On the screenshot you can see a list of maybe 15 subcategories : TB, MT, RD,MA…)

For example, the URL of the first subcategory is : https://forum.MYWEBSITE.com/c/question-formactions/TBD/14

So I guess would like to invite new members automatically to some private subcategory, and Not some Group.

On the URL I gave you, I would like to give only access to the subcategory “TBD” for example.

And, another user will have Only access to another one.

Do you know if it’s possible to do it ?

Maybe I just have to replace the field “group_names” on Zapier, by the one for Categories ?

1 Like

Groups and Categories are a source of much confusion in Discourse!

  1. Groups are collections of people.
  2. Categories are collections of topics. You can’t invite people to them per se. But access to these is controlled by groups.

To achieve what you want, make a group. In the relevant category security settings, add access for that group. Use that group for the invites API. Done.

3 Likes

Thanks for your reply Nathan !

I will try that and post my result here :wink:

2 Likes

Your solution works fine, thanks ! :smiley:

I have another question, maybe you (or @simon) could help me in that :

With Zapier, is there a way to give access to a New group, for people who are already members of Discourse ?

Basically, here is my workflow :

1/ A member joins one of my courses

2/ Zapier takes his email from my learning platform, and send him an invite to my Discourse + add him automatically to the right group, related to the course he just joined.

3/ Sometime, a few months later, this same member will join Another course : So, with my actual process, my Zapier will send him a new invite to Discours, whereas he is already a member, so the invite will not work.

I would need Zapier to give him access to a new group, if he is already a member of my Discourse.

Do you see a way to do that ?

1 Like

You could check with a get action event, if the user already has an account:

And if it’s the case, you run a path where you add this user to a group using a put action:

1 Like

Awesome Krischan ! Thanks for your quick reply ! I’m trying it right now.

The Get part seems to work.

But I have an issue on the Put action :

1 / Can you tell me which Content-type do I have to put in header ?
(I guess I still add my API Username and API Key)

2/ On the URL of the Put Action, do I have to use the group ID (in number, like 110 in your example), or can I use the name I can get on the URL of the groupe ? (like “course-A” for example)

I tried to use the Name of the groupe (I don’t know where can I get the group ID) and it doesn’t seems to work.

Thanks ! :smiley:

1 Like

Content type: multipart/form-data

No, I guess you have to use the group ID. You can get it eg. from the json file: https://meta.discourse.org/g.json

4 Likes

Awesome, with this content type + group ID, it seems to work !

Thanks for your quick help Krischan!

3 Likes

Hi Krischan ! :slight_smile:

Do you know if there is a way to notify the user by email to tell him he has been added to a group (with the Discourse API on Zapier) ?

I know it’s possible to tick a box, when we manually add email to a group on Discourse.

It could be good if I could trigger an email when my Zap is adding them to a new group.

Thanks !

1 Like

Why don’t you send him a private message with a post event?

2 Likes

Thanks for your reply @Krischan !

Do you see a quicker way to notify the user ? (It’s ok if it’s a basic message from discourse, just like the one the user receives if I tick the checkbox “notify the users.”

Screenshot 2021-05-19 at 18.15.37

Your solution is great, but as I have a lot of groups and automations, it could be great if I could just add “one” data type, for example to just “activate” the notification, instead of creating 30 new zap :stuck_out_tongue:

1 Like

Sorry, I haven’t done this yet. But maybe this post can help you:

3 Likes

Thanks for your reply Krischan !
I will check that :slight_smile:

2 Likes

Hi guys :slight_smile:

Do you know if there is a way to Remove a member from a group, using the same logic explained upper ?

I noticed the API has a way to Delete group member : Discourse API Docs

But I’m not sure how to use it on Zapier :confused:

1 Like

Hello,

I need some help here. I’ve followed all the instruction and the link was created. However, the link is not assign to an e-mail. The e-mail field is empty and the user don’t receive any e-mail.

See:

The results: