Transferring data from a fabrik to AcyMailing

hitek6456

New Member
OK, I was able to get it to work by using Joomla User data on another table. But I wanted to try it on another database by using using a table for the user data. The table I created for the user data is called "sk_add". In that table I added the elements of an id, name, and phone. Then I added the databasejoin field in a table called "soulkeeper". In the addon of the soulkeeper form, I added the below code. Can you tell me what I'm doing wrong?

$myAssignedId = '{soulkeeper___soulkeeper_raw}';
$myAssignedId = is_array($myAssignedId) ? $myAssignedId[0] : $myAssignedId;
$myVisitor = '{soulkeeper___name}';
$myPhone = '{soulkeeper___mobile}';
$myVis_Email ='{soulkeeper___email}';

if (!empty($myAssignedId)) {
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('name, email, phone')->from('add_sk')->where('id = ' . $myDb->quote($myAssignedId));
$myDb->setQuery($myQuery);
$myAssignedId = $myDb->loadObject();

if (! include_once JPATH_ADMINISTRATOR . '/components/com_acymailing/helpers/helper.php')
{
throw new RuntimeException("Acymailing not installed");
return false;
}

$myUser = new stdClass();
$myUser->email = $myAssignedId->get email;
$myUser->name = $myAssignedId->get name;
$myUser->skphone = $myAssignedId->get phone;
$myUser->visitor = $myVisitor;
$myUser->phone = $myPhone;
$myUser->visemail = $myVis_Email;

$subscriberClass = acymailing_get('class.subscriber');
$subid = $subscriberClass->save($myUser);

$newSubscription = array();
$newList = array();
$newList['status'] = 1;
$newSubscription[6] = $newList; // Replace 2 with the ID of the list.

$subscriberClass->saveSubscription($subid, $newSubscription);
}
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top