Skip to Content Skip to Menu

CB connections automatic link to acymailing

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
3 weeks 1 day ago #339242 by activha
Hello

I am trying to set up an autoaction to automatically add connections of a user to its acymailing list.

The trigger is onAfterAcceptConnection and the code is pretty simple like 
Code:
onAfterAcceptConnection $ds = DIRECTORY_SEPARATOR; $acyHelper = rtrim(JPATH_ADMINISTRATOR, $ds).$ds.'components'.$ds.'com_acym'.$ds.'helpers'.$ds.'helper.php'; if (!include_once($acyHelper)) {     echo 'This code can not work without the AcyMailing Component';     return false; } $userClass = new AcyMailing\Classes\UserClass(); $acyUserId = '[var2_id]'; $joomlaUserId = '[var1_id]'; $managementListId = acym_loadResult('SELECT id FROM #__acym_list WHERE cms_user_id = '.intval($joomlaUserId)); if(!empty($managementListId)){     $userClass->subscribe($acyUserId, $managementListId, true, true); }

However it fails without any error.
Should I use another trigger ? 
Is there another way to achieve this than a code autoaction ?

Acymailing allows users management in front end and my idea was to add any connection to a user's list if he has one (and allowed by CB subs)

Mind to share your ideas ?
 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
3 weeks 1 day ago #339245 by krileon
Replied by krileon on topic CB connections automatic link to acymailing
The trigger you're using seams correct for what you're trying to do as it would fire when a connection request is accepted. The onAfterAcceptConnection trigger is defined as follows.
Code:
$_PLUGINS->trigger( 'onAfterAcceptConnection', array( $userId, $connectionId, $ueConfig['useMutualConnections'], $ueConfig['autoAddConnections'] ) );

var1 = user id accepting the connection request
var2 = user id that requested the connection
var3 = value of "Mutual Consent" configuration param
var4 = value of "Cross Connections" configuration param

As for subscribing them to newsletter lists is there a reason you're not using the included AcyMailing auto action as it does exactly that?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
3 weeks 1 day ago #339247 by activha
Replied by activha on topic CB connections automatic link to acymailing
Does it subscribe to the user’s list or to the website lists ?
If it can subscribe to a user’s list then that be great

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
3 weeks 1 day ago #339248 by krileon
Replied by krileon on topic CB connections automatic link to acymailing
It subscribes them to whatever lists are selected. I guess that would be website lists.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • activha
  • activha
  • OFFLINE
  • Posts: 2326
  • Thanks: 117
  • Karma: 13
3 weeks 1 day ago #339249 by activha
Replied by activha on topic CB connections automatic link to acymailing
So that will not work as acymailing now has the ability to subscribe to user's list provided they have one in the frontend

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
3 weeks 1 day ago #339250 by krileon
Replied by krileon on topic CB connections automatic link to acymailing
Then you'll have to continue using a Code action and code that yourself. Ensure debug mode and maximum error reporting is enable in Joomla global configuration then in your auto action under Parameters ensure you've enabled Debug to better help debug possible coding errors.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum