Git push mail simple notification hook
Git push mail simple notification hook Http://www.myluoluo.com /? P = 3535
- $ JsonObj = json_decode ($ _ POST ['Hook']);
- If ($ jsonObj-> password! = 'Hiu1234bb76794435ton50obotfwq78 '){
- Exit ('error pwd! ');
- }
- $ MailBody = $ jsonObj-> push_data-> user_name. "a new code is submitted.
"." Project name: ". $ jsonObj-> push_data-> repository-> name ." ".
- 'Project homepage: push_data-> repository-> homepage. '">'. $ jsonObj-> push_data-> repository-> homepage .'
'.
- "Submission time:". $ jsonObj-> push_data-> commits [0]-> timestamp .'
Push_data-> commits [0]-> url. '"> '.
- $ JsonObj-> push_data-> commits [0]-> url .'';
- Include ("class. phpmailer. php ");
- $ Mail = new PHPMailer ();
- $ Mail-> IsSMTP ();
- $ Mail-> SMTPAuth = true;
- $ Mail-> SMTPSecure = "ssl ";
- $ Mail-> Host = "smtp.qq.com ";
- $ Mail-> Port = 465;
- $ Mail-> CharSet = "UTF-8 ";
- $ Mail-> Username = "admin@myluoluo.com ";
- $ Mail-> Password = "xxxxxx ";
- $ Mail-> From = "admin@myluoluo.com ";
- $ Mail-> FromName = "sister Haitang ";
- $ Mail-> Subject = "a new Push ";
- $ Mail-> Body = $ mailBody;
- $ Mail-> IsHTML (true );
- $ Mail-> AddAddress ("admin@myluoluo.com", "sister Haitang ");
- $ Mail-> AddAddress ("o@moe.re", "silly O ");
- If (! $ Mail-> Send ()){
- Echo "Mailer Error:". $ mail-> ErrorInfo;
- } Else {
- Echo "Message sent! ";
- }
- ?>
|