The discussion outlines a proposal to enhance the Discourse invite system via an API that allows bulk token generation, enabling users to send invites through third-party tools like Mailchimp with full control over email content sam. The initial specification involves converting a CSV input of emails into a CSV output of emails and invite links. stevebaer confirms this interpretation aligns with their needs.
The scope was later expanded to include “email-less tokens,” where unique GUIDs are generated first and associated with user details (email, username) only upon redemption sam. techAPJ confirmed the implementation of this feature via pull requests and provided a guide on generating disposable tokens. stevebaer expressed urgency to test the feature for an upcoming event and requested an upgrade to their instance. sam confirmed the deployment was complete.
However, stevebaer encountered a NoMethodError when running the example script, suspecting a missing server method or script issue. techAPJ identified that the instance was likely not returning an array of tokens as expected and offered direct assistance via private message to debug the API key and configuration.
In some cases people may want to send out a batch of invites via a third party tool, mailchimp, boomerang and so on. Many of these platforms are designed for email spam and provide better feedback and statistics.
In some cases people may want complete control over, subject and body of the email. They may want to include custom copy that differs to the standard email.
To achieve this we need to amend our API endopoint to allow for generation of tokens.
The spec is quite simple:
Input is the exact same format our CSV invite takes
Output is a CSV containing emails and invite links
Let me make sure I’m interpreting this correctly. From what I reading, the API call will take a CSV file that contains a list of (email,groups,topic_id)
When the API call is made a CSV file is returned that contains a list of the same length of (email,link) that we can stick in any email body we want for sending out to people.
If this is correct, then that should work great for us.
Great! @sam and @codinghorror we really want to test this as soon as possible. Would it be possible to upgrade our discourse instance with this new feature?
You can use that if you wish, but you will need to tack “emails and username” to every invite you generate, we are building a second part to this that allows you to associate the email with the invite.
Up to you, you can use the disposable tokens if you wish .
I would love to try if possible. We are trying to test this out with an event that is coming up this fall and we want to try and send out emails as soon as possible. I’m assuming our current discourse server does not have the disposable invite feature yet since it was just pushed a few hours ago. Would it be possible to upgrade our server so we can try this?
disposable_invite_tokens.rb:12:in <main>': undefined method body’ for #<Hash:0
x2846be0> (NoMethodError)
I would normally link this to my personal ignorance about ruby, but it looks like much of the script ran and a “NoMethodError” may be signifying that no method on the server exists (wild ass guessing now.) Can you tell if I’m running the script incorrectly or if our discourse server has not been fully deployed with these changes yet?