Skip to content

Commit

Permalink
Re-add matching by group name in start_session actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Feb 22, 2023
1 parent 33662e2 commit 0f6f856
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flows/actions/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ type otherContactsAction struct {
}

func (a *otherContactsAction) resolveRecipients(run flows.Run, logEvent flows.EventCallback) ([]*assets.GroupReference, []*flows.ContactReference, string, []urns.URN, error) {
groupSet := run.Session().Assets().Groups()

// copy URNs
urnList := make([]urns.URN, 0, len(a.URNs))
urnList = append(urnList, a.URNs...)
Expand Down Expand Up @@ -257,6 +259,9 @@ func (a *otherContactsAction) resolveRecipients(run flows.Run, logEvent flows.Ev
// if variable evaluates to a UUID, we assume it's a contact UUID
contactRefs = append(contactRefs, flows.NewContactReference(flows.ContactUUID(evaluatedLegacyVar), ""))

} else if groupByName := groupSet.FindByName(evaluatedLegacyVar); groupByName != nil {
// next up we look for a group with a matching name
groupRefs = append(groupRefs, groupByName.Reference())
} else {
// next up try it as a URN
urn := urns.URN(evaluatedLegacyVar)
Expand Down

0 comments on commit 0f6f856

Please sign in to comment.