Created
August 6, 2012 19:51
-
-
Save jmertic/3277953 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
<?php | |
class MyHookClass | |
{ | |
public function myHook(SugarBean $bean, $event, $arguments) | |
{ | |
$emailObj = new Email(); | |
$defaults = $emailObj->getSystemDefaultEmail(); | |
$mail = new SugarPHPMailer(); | |
$mail->setMailerForSystem(); | |
$mail->From = $defaults['email']; | |
$mail->FromName = $defaults['name']; | |
$mail->Subject=from_html($bean->name); | |
$mail->Body=from_html("Email alert that '{$bean->name}' was saved"); | |
$mail->prepForOutbound(); | |
$mail->AddAddress('jmertic@sugarcrm.com'); | |
@$mail->Send(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment