AcyMailing list SQL statements

9 years 2 months ago #136336 by ThePiston
would it be better to use another SQL action slot if I want to subscribe a user to 2 or more newsletters at the same time or can I alter the code to do this in one action?

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X
9 years 2 months ago #136339 by joomextensions.com
You can do that in one query:

[code:1]INSERT IGNORE INTO `#__acymailing_listsub` ( `listid`, `subid`, `subdate`, `status` )
VALUES ( <listid1>, ( SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ), UNIX_TIMESTAMP( NOW() ), 1 ),
( <listid2>, ( SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ), UNIX_TIMESTAMP( NOW() ), 1 ),
( <listid3>, ( SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ), UNIX_TIMESTAMP( NOW() ), 1 )
[/code:1]
9 years 2 months ago #136342 by ThePiston
thanks - what about multiple deletions upon deactivation?

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X
9 years 2 months ago #136355 by joomextensions.com
About the deletion:

[code:1]DELETE FROM `#__acymailing_listsub` WHERE ( (`listid` IN (<listid1>,<listid2>,<listid3>«»)) AND (`status` = 1) AND (`subid` = (SELECT `subid` FROM `#__acymailing_subscriber` WHERE `userid` = [user_id] ) ) )[/code:1]
9 years 2 months ago #136406 by krileon
We've approved the development of an AcyMailing integration that will be available with next CBSubs release. The integration features usage of AcyMailing API as well. Just a heads up for those needing ACyMailing integration. ;)


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
9 years 2 months ago #136413 by joomextensions.com
That's great! :)
Moderators: beatnantkrileon
Time to create page: 0.392 seconds
Facebook Twitter Google LinkedIn