Created
April 2, 2013 08:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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