Announcement

Collapse
No announcement yet.

How to set Teams for Email using Hook

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

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

    Comment

    Working...
    X