protected function getContactData(SubmissionEntity $submission) { $contactData = new ContactData(); /* * $attributes = array( * "PreferredMethod" => "PrimaryPhone", * "PreferredTime" => "Any" * ); */ $InternetEmailAddress = $submission->getDetail()->getEmail(); $PrimaryPhone = $submission->getDetail()->getPhone(); // $contactData->setAttributes($attributes); $contactData->setInternetEmailAddress($InternetEmailAddress); $contactData->setPrimaryPhone($PrimaryPhone); return $contactData; }
protected function getContactData(Lead $lead) { $contactData = new ContactData(); $Email = $Phone = ""; foreach (['Email', 'Phone'] as $key) { ${$key} = $this->getLeadAttributeValue($lead, $key); } $contactData->setInternetEmailAddress($Email); $contactData->setPrimaryPhone($Phone); return $contactData; }