<?php 
$email_format = DB::table('notification')->where('id',8)->first();
		            
$client = DB::table('client')->where('client_id',7)->first();

$address_query = DB::table('client_address')->where('client_id',7)->first();
if($address_query){
    $billing_address = $address_query->house.','.$address_query->road.','.$address_query->district.','.$address_query->police_station.','.$address_query->post_office.','.$address_query->post_code;
}else{
  $billing_address = '';  
}
$temporary_password = 'infolink123';

$m1 = str_replace('[[client_id]]',$client->client_id,$email_format->message);

$m2 = str_replace('[[contact_person]]',$client->contact_person,$m1);

$m3 = str_replace('[[username]]',$client->client_username,$m2);

$m4 = str_replace('[[email]]',$client->client_email1,$m3);

$m5 = str_replace('[[contact_person]]',$client->contact_person,$m4);

$m6 = str_replace('[[temporary_password]]',$temporary_password,$m5);

$m7 = str_replace('[[contact_number1]]',$client->client_phone1,$m6);

$m8 = str_replace('[[contact_number2]]',$client->client_phone2,$m7);

$m9 = str_replace('[[billing_address]]',$billing_address,$m8);

echo $m9;
?>