From 0fd239687d5e35a982a570b8164a883cc8d2d3e4 Mon Sep 17 00:00:00 2001 From: sikanderzel Date: Thu, 2 Jun 2016 19:50:39 +0500 Subject: [PATCH] Two functions added for friend request mail --- upload/includes/classes/cbemail.class.php | 27 ++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/upload/includes/classes/cbemail.class.php b/upload/includes/classes/cbemail.class.php index 72b765eb..e27df8e8 100644 --- a/upload/includes/classes/cbemail.class.php +++ b/upload/includes/classes/cbemail.class.php @@ -132,8 +132,10 @@ class CBEmail */ function add_mass_email($array=NULL) { + if(!$array) $array = $_POST; + //pex($array,true); global $userquery,$db; @@ -145,7 +147,7 @@ class CBEmail $method = $array['method']; unset($array['method']); $settings = $array; - + //pex($users,true); unset($array); if(!isValidEmail($from)) @@ -229,6 +231,21 @@ class CBEmail return false; } } + + + function get_email_by_userid($id) + { + global $db; + $result = $db->select(tbl("users"),"email","userid='$id'"); + if($db->num_rows>0) + { + return $result[0]; + }else + { + return false; + } + } + function email_exists($id){ return $this->get_email($id); } @@ -377,6 +394,14 @@ class CBEmail } } + + + function friend_request_email($email,$username){ + $msg = $username." wants to add you as a friend"."
"; + $subj = "Friend Request"; + cbmail(array('from_name'=>TITLE, 'to'=>$email,'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg)); + + } } ?> \ No newline at end of file