Created
February 12, 2010 18:42
-
-
Save visnup/302842 to your computer and use it in GitHub Desktop.
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
# 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