Created
July 4, 2014 12:32
-
-
Save matthewpoer/3bf248e43d98ebd6f5ec to your computer and use it in GitHub Desktop.
SugarCRM: How to get a record's email address in Sugar7 API vs. legacy services (including web to lead form entrypoint)
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
class myClass{ | |
public function myMethod($bean,$event,$arguments){ | |
// if we are using a legacy API or web-to-lead form, email address is in email1 | |
$GLOBALS['log']->fatal("email1 value: {$bean->email1}"); | |
// but if we're on that sugar7 API or sugar7 interface (which uses said API...) | |
$sea = new SugarEmailAddress(); | |
$email = $sea->getPrimaryAddress($bean); | |
$GLOBALS['log']->fatal("sea value: {$email}"); | |
$GLOBALS['log']->fatal("Request: " . print_r($_REQUEST,true)); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment