Skip to content

Instantly share code, notes, and snippets.

@chicks
Created November 16, 2010 19:16
Show Gist options
  • Save chicks/702313 to your computer and use it in GitHub Desktop.
Save chicks/702313 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
require 'rubygems'
require 'sugarcrm'
SugarCRM.connect("http://localhost/sugarcrm", 'user', 'password')
SugarCRM::Account.find_by_name("JAB Funds Ltd.").contacts.each do |contact|
contact.email_addresses.each do |email|
puts "#{email.email_address}" unless email.opt_out == "1"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment