         @render()
 
 
-    onNewGuest: ->
-        email = @$('input[name="guest-name"]').val()
+    # Handle guest addition. `userInfo` is passed when called by the typeahead.
+    onNewGuest: (userInfo = null) ->
+
+        if userInfo?
+            [email, contactID] = userInfo.split(';')
+        else
+            email = @$('input[name="guest-name"]').val()
+            contactID = null
+
         guests = @model.get('attendees') or []
         if not _.findWhere(guests, email: email)
             # Clone the source array, otherwise it's not considered as

            $guests.append row


    onRemoveGuest: (event) ->
        # Get which guest to remove.
        index = @$(event.target).parents('li').attr 'data-index'

        "click .add-new-guest": "onNewGuest"
        "click .guest-delete": "onRemoveGuest"
        'keyup input[name="guest-name"]': "onKeyup"


    # Flag used in order to prevent the typeahead from being reinitialized at
    # each render.
    _configured: false


    getRenderData: ->
