sitecore Engagement Automation Get the contact by username


Example

ContactManager contactManager = Factory.CreateObject("tracking/contactManager", true) as ContactManager;
    
Contact contact = contactManager.LoadContactReadOnly(userName);
return contact;