Permalink
Browse files

Leads and Contacts have an alt_email, we should also try that when sc…

…anning dropbox assets (thanks, Craig)
  • Loading branch information...
michaeldv committed Nov 28, 2010
1 parent 2e49fb3 commit c4d9ccda18b598dd0a7c8c4d1314eb3ba57a5a44
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/fat_free_crm/dropbox.rb
@@ -241,6 +241,12 @@ def find_and_attach(email, recipient)
attached = false
ASSETS.each do |klass|
asset = klass.find_by_email(recipient)
+
+ # Leads and Contacts have an alt_email: try it if lookup by primary email has failed.
+ if asset.empty? && klass.column_names.include?("alt_email")
+ asset = klass.find_by_alt_email(recipient)
+ end
+
if asset && sender_has_permissions_for?(asset)
attach(email, asset)
attached = true

0 comments on commit c4d9ccd

Please sign in to comment.