You are here

function hook_entityreference_autocreate_new_saved_entity_alter in Entityreference Autocreate 7

Allows modules to interact with the entity that was just created.

You can use this to send notifications per example.

Parameters

string $target_id: The entity id.

string $entity_type: The entity type.

1 invocation of hook_entityreference_autocreate_new_saved_entity_alter()
entityreference_autocreate_new_entity in ./entityreference_autocreate.module
Create a placeholder item of the type described in the field settings.

File

./entityreference_autocreate.api.php, line 34
Hooks provided by the entityreference_autocreate module.

Code

function hook_entityreference_autocreate_new_saved_entity_alter($target_id, $entity_type) {

  // Load the entity.
  if ($entity_type == 'user') {
    $user = user_load($target_id);
    _user_mail_notify('register_admin_created', $user);
  }
}