Skip to content

Instantly share code, notes, and snippets.

@visnup
Created February 12, 2010 18:42
Show Gist options
  • Save visnup/302842 to your computer and use it in GitHub Desktop.
Save visnup/302842 to your computer and use it in GitHub Desktop.
# check for person
person = Highrise::Person.find :first, :from => :search,
:params => { :criteria => { :email => contact.email } }
unless person
# otherwise, create manually using a fucked up contact_data hash/array
person = Highrise::Person.create :name => contact.name,
:contact_data => {
:email_addresses => [
{ :address => contact.email,
:location => 'Work' }
]
}
end
# then finally create a new "email" linking to the person
email = Highrise::Email.new :body => contact.message,
:title => 'website lead'
email.prefix_options = { :person_id => person.id }
email.save
# of course, I can just send an email to the dropbox address, but I hate sending email even more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment