Created
June 27, 2018 17:27
-
-
Save JRondeau16/d1d7c79a1b1d73cdd423480f727cae68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult ContactUs() | |
{ | |
var model = new ContactUsViewModel(); | |
if ((Tracker.Current != null) && (Tracker.Current.Contact != null)) | |
{ | |
var contact = Tracker.Current.Contact; | |
var personal = contact.GetFacet<IContactPersonalInfo>("Personal"); | |
var phoneFacet = contact.GetFacet<IContactPhoneNumbers>("Phone Numbers"); | |
var addressFacet = contact.GetFacet<IContactAddresses>("Addresses"); | |
var emailFacet = Tracker.Current.Contact.GetFacet<IContactEmailAddresses>("Emails"); | |
model.Name = personal.FirstName + " " + personal.Surname; | |
if(emailFacet.Entries.Contains("SFMCEmail")) | |
model.Email = emailFacet?.Entries["SFMCEmail"]?.SmtpAddress; | |
if (phoneFacet.Entries.Contains("HomePhone")) | |
model.Phone = phoneFacet.Entries["HomePhone"]?.Number; | |
} | |
return View(model); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment