application/controllers/Common.php
/* function for sending email while cancle the class by admin */
function for sending email while cancle the class by admin
function for sending email while cancle the class by admin
function sendMail($user_name,$searchName,$users_emails,$link,$status)
    {
    	if($status == 'added'){
    		$msg= '<html>
                  <head></head>
                    <body style="color: black;">
                      <p>Dear User <br><br></p>
                      <p>'.$user_name.' has added you to '.$searchName.' <br><br>
                      </p>
                      <p>Please click below to download app.<br><br></p>
		                	<strong><a href="'.$link.'" style="text-decoration: none !important;">Download</a><br><br></strong>
                      <p>Sincerely,<br>Urban Collective customer service<br>
                      </p>         
                    <body>
            </html> '; 
    	}	
    	if($status == 'deleted'){
    		$msg= '<html>
                  <head></head>
                    <body style="color: black;">
                      <p>Dear User <br><br></p>
                      <p>'.$user_name.' has deleted you from '.$searchName.' <br><br>
                      </p>
                      <p>Sincerely,<br>Urban Collective customer service<br>
                      </p>         
                    <body>
            </html> '; 
    	}
          $mail = new PHPMailer(true); 
          $mail->IsSMTP(); 
        try{
	          $mail->IsHTML(true);      
	          $mail->SMTPDebug = 1;                                                        
	          $mail->Host = "smtp.googlemail.com"; 
	          $mail->Port = "587"; 
	          $mail->SMTPAuth = true; 
	          $mail->Username = "urbancotech@gmail.com"; 
	          $mail->Password = "TheUrbanCollective"; 
	          $mail->SMTPSecure  = 'tls'; 
	          $mail->SetFrom("urbancotech@gmail.com",'TheUrbanCollective');
	          if($status == "deleted"){
	          	$mail->Subject = "Deleted from tribe";
	          }
	          if($status == "added"){
	          	 $mail->Subject = "Invitation for tribe";
	          }
	          $mail->Body = $msg;         
	          foreach($users_emails as $email1){
	          	$mail->AddAddress($email1);
	          }
	          $send = $mail->Send(); 
	          if($send){
	              return true;
	          }else{
	              return false;
	          }
          } catch (phpmailerException $e) {
          			return false;
			} catch (Exception $e) {
			  	return false;
			}
    }
function sendMail ( $ user_name , $ searchName , $ users_emails , $ link , $ status ) { if ( $ status == 'added' ) { $ msg = '<html>
                  <head></head>
                    <body style="color: black;">
                      <p>Dear User <br><br></p>
                      <p>' . $ user_name . ' has added you to ' . $ searchName . ' <br><br>
                      </p>
                      <p>Please click below to download app.<br><br></p>
		                	<strong><a href="' . $ link . '" style="text-decoration: none !important;">Download</a><br><br></strong>
                      <p>Sincerely,<br>Urban Collective customer service<br>
                      </p>         
                    <body>
            </html> ' ; } if ( $ status == 'deleted' ) { $ msg = '<html>
                  <head></head>
                    <body style="color: black;">
                      <p>Dear User <br><br></p>
                      <p>' . $ user_name . ' has deleted you from ' . $ searchName . ' <br><br>
                      </p>
                      <p>Sincerely,<br>Urban Collective customer service<br>
                      </p>         
                    <body>
            </html> ' ; } $ mail = new PHPMailer ( true ) ; $ mail -> IsSMTP ( ) ; try { $ mail -> IsHTML ( true ) ; $ mail -> SMTPDebug = 1 ; $ mail -> Host = " smtp.googlemail.com " ; $ mail -> Port = " 587 " ; $ mail -> SMTPAuth = true ; $ mail -> Username = " urbancotech@gmail.com " ; $ mail -> Password = " TheUrbanCollective " ; $ mail -> SMTPSecure = 'tls' ; $ mail -> SetFrom ( " urbancotech@gmail.com " , 'TheUrbanCollective' ) ; if ( $ status == " deleted " ) { $ mail -> Subject = " Deleted from tribe " ; } if ( $ status == " added " ) { $ mail -> Subject = " Invitation for tribe " ; } $ mail -> Body = $ msg ; foreach ( $ users_emails as $ email1 ) { $ mail -> AddAddress ( $ email1 ) ; } $ send = $ mail -> Send ( ) ; if ( $ send ) { return true ; } else { return false ; } } catch ( phpmailerException $ e ) { return false ; } catch ( Exception $ e ) { return false ; } }
function for sending email while cancle the class by admin
function for sending email while cancle the class by admin
//echo $message;exit(); //echo $msg;exit(); // include the class name         // create a new object //Hostname of the mail server  ssl://smtp.googlemail.com //Port of the SMTP like to be 25, 80, 465 or 587  ////465 //Whether to use SMTP authentication //Username for SMTP authentication any valid email created in your domain  bamgude.sachin@gmail.com //Password for SMTP authentication  //    $mail->SetFrom("bamgude.sachin@gmail.com"); //To //$mail->AddBCC($email1);//whom to send mail   // $mail->AddCC(""); //Send the mails //echo $mail->ErrorInfo;exit(); //print_r($mail->ErrorInfo);exit(); // $this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'MAIL SENDING FAIL','Result'=>$send), 400); // $this->response(array('ResponseCode' => 0, 'ResponseMessage' => 'FAILURE', 'Comments' => 'MAIL SENDING FAIL','Result'=>$send), 400);