Automate sending Discourse invite emails with Zapier

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:

1 Like

Has anyone had error messages on their email invite zap’s recently? In my case I get 403 and 404’s and some invites are not sent out successfully

It sounds like a permission issue with either the Api-Key or Api-Username. Try checking both of those on your Discourse site. Make sure that the user you have supplied for the Api-Username is still active on the site and that the Api-Key has either the Global scope, or has a Granular scope with the Invites scope box checked.

Let us know if that doesn’t fix the issue.

I’m bumping Juliano’s message because I tried this just now and experienced the same thing. How do I ensure that the invitation I create is an email invitation? I seem to be able to create only link invitations, although those work just fine.

1 Like

A little update on this, since I’m trying again.

Zapier’s Discourse integration app appears to have a defect: it maps both the “email” and the “skip_email” POST request body value to the same key: “skip_email”. This results in Discourse receiving an HTTP POST request with no “email” item in the request body, so the invite is created as a “link” invite rather than an “email” invite.

I’m sending Zapier a support email. We’ll see what happens. :person_shrugging:

If I use Zapier’s generic Webhook feature, I can create the invitation, but Discourse isn’t sending the email, so I need to figure out why not. I’ll follow up when I learn more.

1 Like

Any way to do this using make.com instead of Zapier? It functions similarly and has Discourse integration, but I can’t find an invite command.

I’m sure there is.

The Discourse Zapier integration doesn’t have an Invite command either. This topic is actually explaining how to get around that issue by using a Zapier action step that allows you to make an API call to Discourse. I’m fairly sure you can achieve the same thing on make.com by using their Make an API Call action: https://www.make.com/en/integrations/discourse.

You might find useful details in this topic’s OP about how to set that up. If you have questions about getting it to work, it would be best to ask them here: How to Connect Discourse with Hundreds of Apps Using Integromat. (Integromat was renamed to Make.com).

@JammyDodger the topic that I linked to should probably be renamed and edited to make it clear that it refers to Make.com not Integromat.

3 Likes

Thanks so much for the reply and links. I had not known that Make.com had another name previously, so that helps. I’ll take a crack at it.