Skip to content

External contacts search

Matthieu Rakotojaona edited this page Aug 18, 2015 · 2 revisions

When in a recipient field, the tab key will autocomplete the current input with relevant email or names. This data can come from emails that are already stored and parsed in sup, but it can also come from outside programs through the extra-contact-addresses hook. This hook takes nothing in input and gives back all known addresses for further completion by sup.

Here's an example hook with goobook, a tool to access your google account contacts:

`goobook query ''`.split("\n").map do |line|
  matches = line.match(/^(?<email>[^\s]+)\t(?<name>[^\t]+)\t.*$/)
  "#{matches[:name]} <#{matches[:email]}>" if matches
end.compact
Clone this wiki locally