Skip to content

Instantly share code, notes, and snippets.

@genewoo
Created April 2, 2013 08:42
Show Gist options
  • Save genewoo/5290837 to your computer and use it in GitHub Desktop.
Save genewoo/5290837 to your computer and use it in GitHub Desktop.
Send email to all GitLab User, output will be a list user email address. You can put in your mail client and sent to all of your gitlab users
require 'net/http'
require 'json'
YOUR_API_KEY="INPUT YOUR ADMIN PRIVATE_KEY HERE"
YOUR_SERVER_HOST="YOUR HOST"
response = Net::HTTP.get_response(YOUR_SERVER_HOST, "/api/v3/users?private_token=${YOUR_API_KEY}")
users = JSON.parse response.body
puts users.map{|user| user["email"] + ";"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment