diff --git a/modules/Contacts/Contacts.php b/modules/Contacts/Contacts.php
index 61e4c11efb67653ecb9a04eab5b4fc4f31790997..68f72ce4ff8ac2beed875f4cf32e4007731b349b 100644
--- a/modules/Contacts/Contacts.php
+++ b/modules/Contacts/Contacts.php
@@ -1537,13 +1537,6 @@ function get_contactsforol($user_name)
 		$contents = str_replace('$support_team$',getTranslatedString('Support Team', $moduleName),$contents);
 		$contents = str_replace('$logo$','<img src="cid:logo" />',$contents);
 
-		//Company Details
-		$contents = str_replace('$address$',$companyDetails['address'],$contents);
-		$contents = str_replace('$companyname$',$companyDetails['companyname'],$contents);
-		$contents = str_replace('$phone$',$companyDetails['phone'],$contents);
-		$contents = str_replace('$companywebsite$',$companyDetails['website'],$contents);
-		$contents = str_replace('$supportemail$',$HELPDESK_SUPPORT_EMAIL_ID,$contents);
-
 		if($type == "LoginDetails") {
 			$temp=$contents;
 			$value["subject"]=decode_html($adb->query_result($result,0,'subject'));
diff --git a/modules/Migration/schema/720_to_721.php b/modules/Migration/schema/720_to_721.php
index 4d156c7faa1d712e6849aebbfb93ba8a22975658..002d1612b9de4b4b9b9def55b50479173ddc6042 100644
--- a/modules/Migration/schema/720_to_721.php
+++ b/modules/Migration/schema/720_to_721.php
@@ -145,4 +145,71 @@ if (defined('VTIGER_UPGRADE')) {
     
     $em->registerHandler('vtiger.entity.afterrelate', 'modules/Vtiger/handlers/RelateEntitesHandler.php', 'RelateEntitesHandler');
 	echo '<br>Succecssfully added before relate handler<br>';
+    
+    //Updating customer-portal email template
+    $result = $db->pquery("SELECT templateid FROM vtiger_emailtemplates WHERE subject = ?", array('Customer Portal Login Details'));
+    if ($db->num_rows($result)) {
+        $templateId = $db->query_result($result, 0, 'templateid');
+    }
+    if(!empty($templateId)){
+        $portalLoginTemplateRecord = EmailTemplates_Record_Model::getInstanceById($templateId);
+        $portalLoginTemplateContent = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+        <html>
+        <head>
+          <title></title>
+        </head>
+        <body class="scayt-enabled">
+          <!-- <center> -->
+            <table border="0" cellpadding="0" cellspacing="0" class="borderGrey" width="600px" style="margin-left:0px;">
+              <tbody>
+                <tr>
+                  <td colspan="6"><!-- Begin Pre header --><!-- // End Pre header \ --></td>
+                </tr>
+                <tr style="height:50px;">
+                  <td colspan="6" style="
+                  font-family: Helvetica,Verdana,sans-serif">
+                  <div style="margin-bottom:10px;color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);"><br />
+                    Dear $contacts-firstname$ $contacts-lastname$,</div>
+
+                    <div style="margin-top:20px;margin-bottom:20px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">As our customer, you can be assured of getting excellent support from our team. I would like to take this opportunity to introduce the portal we have setup for valuable customers like you. You can submit questions/issues via the portal, see past issues and responses. In addition, Portal provides you access to our knowledge base and documents we shared with you in the past.
+                    </div>
+
+                    <div style="margin-top:10px;color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">$URL$ to login to the portal, with the credentials below.</div>
+
+                    <div style="margin-top:20px;color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">Your Username: $login_name$</div>
+
+                    <div style="margin-bottom:20px;color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">Your Password: $password$</div>
+                    <div class="gmail_extra" style="margin-top:10px;color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);">Thank you,<br />
+                      $contacts-smownerid$</div>
+
+                    </td>
+                  </tr>
+                  <tr>
+                    <td colspan="6" style="font-family: Helvetica,Verdana,sans-serif;font-size: 11px;color: #666666;">
+                      <table border="0" cellpadding="4" cellspacing="0" width="100%">
+                        <tbody>
+                          <!--copy right data-->
+                          <tr>
+                            <td valign="top" style="
+                            padding-left: 0px;
+                            padding-right: 0px;
+                            width:350px">
+                                <div style="margin-top:20px;"><em>Powered By <a href="www.vtiger.com">Vtiger</a><div>
+                            </td>
+                          </tr>
+                          <!--subscribers links-->
+                        </tbody>
+                      </table>
+                    </td>
+                  </tr>
+                </tbody>
+              </table>
+            <!-- </center> -->
+          </body>
+          </html>';
+        $portalLoginTemplateRecord->set('body', $portalLoginTemplateContent);
+        $portalLoginTemplateRecord->save();
+        $portalLoginTemplateId = $portalLoginTemplateRecord->getId();
+        echo "Customer portal login template created.<br>";
+    }
 }
\ No newline at end of file