How to set Teams for Email using Hook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • override
    Junior Member
    • Mar 2018
    • 21

    How to set Teams for Email using Hook

    Hi,

    How to set Teams in Email using Hook?
    I have tried something like this in afterSave

    $entityManager = $this->getEntityManager();
    $allTeams = $entityManager->getRepository('Team')->getAll();
    $entity->set('teams', $allTeams->current()->get('id'));
    $entityManager->saveEntity($entity, array('SkipAll' => true));

    It doesn't set new team.
    It should work in beforeSave also by just avoiding saveEntity, just calling set?
  • override
    Junior Member
    • Mar 2018
    • 21

    #2
    Ok, I've used 'teams' instead of 'teamsIds' which was mistake.

    Comment

    Working...