I've got a custom module weekly_digest
and I want to make it so each new user is added to a table with info on their subscription preferences.
I've been using the admin UI to add the users to test, unsure if that effects things but I don't see why it would.
As some context, in my .module I currently have weekly_digest_node_insert
and that works just fine.
And here is the function which does not get executed and I can't get Xdebug to catch it either:
function weekly_digest_user_insert(UserInterface $entity) {
$query = Drupal::database()->insert('weekly_digest_user_preferences');
$query->fields([
'uid',
])->useDefaults([
'new_posts',
'digests',
])->values([
$entity->id(),
])->execute();
}
Most search results returned "Can't in theme" or "Drupal 7" so I was unable to figure this out.