Entity Reference - Not required to be in database I have a content type Proposal with a entity reference field Proposed by. This is an autocomplete field that targets Users in the application. You can give in multiple users that are in the application.

But now I would like to give the possibility to the user that they can give in user that are NOT in the application. So they can enter email addresses from random persons, they will receive an email with a link to register. But how can I get this data? Because it's not saved when the user isn't in the application.

I tried to do this with hook_node_validate but this is the result I get:

array (size=1)
'und' =&gt; 
  array (size=4)
    0 =&gt; 
      array (size=2)
        'target_id' =&gt; string '26' (length=2)
        '_weight' =&gt; string '0' (length=1)
    1 =&gt; 
      array (size=2)
        'target_id' =&gt; null
        '_weight' =&gt; string '1' (length=1)
    2 =&gt; 
      array (size=2)
        'target_id' =&gt; string '' (length=0)
        '_weight' =&gt; string '2' (length=1)
    'add_more' =&gt; string 'Add another item' (length=16)


So no email address that I gave in.. Just a target_id = null. How could I do this?
Entity Reference can reference entities only. It would be a really big hack to the module to allow non-entities to be referenced. But there is no need to.

There are dedicated modules for exactly what you are trying to do. Instead of Entity Reference, create User Relationships. Use User Relationship Invites submodule, it


  allows users to specify a relationship to a user that they invite to join the site.


Invitation is done by using e-mail, so it seems this will fully satisfy your use case.