• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: RSFORM & Acymailing with dropdownlist field

RSFORM & Acymailing with dropdownlist field 5 years 10 months ago #38189

  • nino59
  • nino59's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Thank you received: 1
Hi,

I have Joomla 3.8 and RSFORM 2.0

I have a dropdownlist field with list of breeds of dogs.
I have in acylmailing 1 List for each breed of dog.


When visitor select a breed and submit RSFORM, I would like to add this visitor to the appropriate Acymailing list corresponding to the breed of dog visitor selected in RSFORM.

I add this code:
$postData = $_REQUEST['form'];
 
 include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_acymailing'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php');
 
 $myUser = new stdClass();
 $myUser->email = strip_tags($postData['email_field']); //Please replace email_field by your own field name (the name of the field "email").
 $myUser->name = strip_tags($postData['name_field']); //Please replace name_field by your own field name (the name of the field "name").
 $subscriberClass = acymailing_get('class.subscriber');
 
 
 
if ($breed_dog == "Airedale terrier") {
	$subscribe = array(7) ;
}
if ($breed_dog == "Akita Américain") {
	$subscribe = array(8);
}
 
if(empty($subscribe)){
//Mail : no list selected
}
 
$_REQUEST['subscription'] = $subscribe;
 
 
 $subid = $subscriberClass->save($myUser);
 
 
$subscriberClass->sendConf($subid); //we send the confirmation email... only if needed based on the current user status and the option from the Acy configuration page.
 
 $newSubscription = array();
 if(!empty($subscribe)){
 foreach($subscribe as $listId){
 $newList = array();
 $newList['status'] = 1;
 $newSubscription[$listId] = $newList;
 }
 }
 $subscriberClass->saveSubscription($subid,$newSubscription);

Can someone help me to add my visitors in appropriate Acymailing list?

THanks
The administrator has disabled public write access.

RSFORM & Acymailing with dropdownlist field 5 years 9 months ago #38259

Did you mange to solve this?

If not I can help you.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!