Created
April 21, 2014 12:37
-
-
Save matthewpoer/11141580 to your computer and use it in GitHub Desktop.
SugarCRM Email Link Generation, mailto or Sugar Email Client popup (JavaScript)
This file contains hidden or 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
| // need to know which user we are because the User Preference drive the type of link | |
| global $current_user; | |
| $field = 'email1' // alternative is email2 | |
| // form the link, i.e. mailto: or javascript for the popup. $focus could be Lead, Contact, Target, etc... | |
| // @see User::getEmailLink | |
| $email_link = $current_user->getEmailLink($field,$focus,null, | |
| $_REQUEST['module'],$_REQUEST['action'],$_REQUEST['record']); | |
| // we have the link opener, but we need the anchor text and to close the element | |
| $email_link .= $lead->$focus . "</a>"; | |
| // if we are spitting this out into a view, assign it to a smarty variable | |
| $this->ev->ss->assign('email_link',$email_link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment