Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not sending customer portal pasword
i am working with the extinted customer fortal from MYC Make Your Cloud
and i have enabled a global variable

Application_Customer_Portal_BeingUsed vtigercrmportal

everything works fine but i am not able of send the password
variable in the wellcome email

i had tryed

But none of them works Huh
the correct syntax is $user_password$

but that works only when sent through the activation of the contact (I think)
i thinks it's related with system upgrade on activatePortalFieldsContacts
even when i tried to disable this upgrade the field that cames with it still there
and normal uldate of the vtiger_portalinfo stoped working and the system
don't add new credentials to this table

also have this 2 uprades related enabled

i thougt to add this proglem to github but still not sure if is related to the MYC portal interconection
global variable for this its correct? (Application_Customer_Portal_BeingUsed vtigercrmportal)
the template is searched by name:

Customer Login Details

Have you changed that name?

If I remember correctly this variable is only for PDF output Application_Customer_Portal_BeingUsed
searching i ad found that the function invoqued from the worqflow its SendPortalLoginDetails

the function that seems to be making this work it's Contacts_sendCustomerPortalLoginDetails
in Contactshandler.php

i had get the solution of activating the customer portal enabling this function on a workflow

but still it dont send the email maibe becouse it don't find the tempate... how it indicates which is the temlate

to be sended?

this function also seems to update the activation if the portal user is not disabled and disabling it on the database

but it doesnt work for me...

function Contacts_sendCustomerPortalLoginDetails($entityData) {
$adb = PearDatabase::getInstance();
//$moduleName = $entityData->getModuleName();
$wsId = $entityData->getId();
$parts = explode('x', $wsId);
$entityId = $parts[1];

$email = $entityData->get('email');

if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
$result = $adb->pquery('SELECT id, user_name, user_password, isactive FROM vtiger_portalinfo WHERE id=?', array($entityId));
$insert = false;
if ($adb->num_rows($result) == 0) {
$insert = true;
} else {
$dbusername = $adb->query_result($result, 0, 'user_name');
$isactive = $adb->query_result($result, 0, 'isactive');
if ($email == $dbusername && $isactive == 1 && !$entityData->isNew()) {
$update = false;
} elseif ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
$adb->pquery('UPDATE vtiger_portalinfo SET user_name=?, isactive=1 WHERE id=?', array($email, $entityId));
$password = $adb->query_result($result, 0, 'user_password');
$update = true;
} else {
$adb->pquery('UPDATE vtiger_portalinfo SET user_name=?, isactive=? WHERE id=?', array($email, 0, $entityId));
$update = false;
if ($insert == true) {
$password = makeRandomPassword();
'INSERT INTO vtiger_portalinfo(id,user_name,user_password,type,isactive) VALUES(?,?,?,?,?)',
array($entityId, $email, $password, 'C', 1)

if ($insert == true || $update == true) {
require_once 'modules/Emails/mail.php';
global $current_user;
$emailData = Contacts::getPortalEmailContents($entityData, $password, 'LoginDetails');
$subject = $emailData['subject'];
$contents = $emailData['body'];
send_mail('Contacts', $entityData->get('email'), $current_user->user_name, "", $subject, $contents);
} else {
$adb->pquery('UPDATE vtiger_portalinfo SET user_name=?,isactive=0 WHERE id=?', array($email, $entityId));

'Customer Login Details'

Forum Jump:

Users browsing this thread: 1 Guest(s)