I have been playing with the
AcyMailing list
system by the Acyba team and have figured out - with the help of krileon (thanks) - the following SQL integration scripts.
This one subscribes a user to a specific AcyMailing list with listid number = <listid> (you need to look at your jos_acymailing_list table to find the listid you need or you can just look at your backend Components -> AcyMailing -> Lists area to find the listid of your list (right column). Make sure you substitute <listid> with your listid value.
[code:1]INSERT INTO `#__acymailing_listsub` ( `listid`, `subid`, `subdate`, `status` ) VALUES ( <listid>, ( SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ), UNIX_TIMESTAMP( NOW() ), 1 )[/code:1]
And this one removes the subscription (once again remember to replace <listid> with your listid:
[code:1]DELETE FROM `#__acymailing_listsub` WHERE ( (`listid` = <listid>«») AND (`status` = 1) AND (`subid` = (SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ) ) )[/code:1]