Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

[SOLVED] Adding Users to Second User Group & Second Email List

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
8 months 3 days ago - 8 months 1 day ago #337910 by AlexRag
Here is a use case:  

I have a Yes/No question in the registration.  Regardless of the answer, the user is added to a specific Joomla user group and a specific AcyMailing list.   They are also moved to a different email list if deactivated.

If the answer is YES, I want to also add them to a second email list (AcyMailing) and/or add them to a second Joomla user group.

Is this possible?  If so what is the best way to do this?

 
Last edit: 8 months 1 day ago by AlexRag.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
8 months 3 days ago - 8 months 3 days ago #337912 by krileon
You could do that using CB Auto Actions. It includes an AcyMailing auto action type for subscribing users to newsletters. Something like the following should work.

Global
Triggers: onAfterUserRegistration
Type: AcyMailing
User: Automatic
Access: Everybody
Conditions
Field: SELECT_YESNO_FIELD_HERE
Operator: Equal To
Value: 1

Now you'd just configure the AcyMailing parameters as desired. You can make a second auto action to handle usergroups using the Usergroup auto action type. Note this only applies to frontend registrations. If you need it to apply to backend and profile updates you'll need to add additional triggers from the below list.

Backend
Registration = onAfterNewUser
Edit = onAfterUpdateUser

Frontend
Registration = onAfterUserRegistration
Edit = onAfterUserUpdate


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.
Last edit: 8 months 3 days ago by krileon.
The following user(s) said Thank You: AlexRag

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

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
8 months 3 days ago #337913 by AlexRag
Awesome.  Auto Actions to the rescue.    

Thanks for the advice about the back end as well.   I add members infrequently in the back end so may add the list and user groups manually, though its good to know it can also be automated!

Thanks!

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

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
8 months 2 days ago #337916 by AlexRag
Follow-up questions:

1. For Value: 1.    Would I put the #1 or the word Yes?

2. On the flip side, if the user goes in later to update the answer to No, I would want to automatically remove them from the Mailing List and/or user group.   Which Auto Acttion would be ideal for a user editing their profile?

Thanks!


 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
8 months 2 days ago #337920 by krileon

1. For Value: 1. Would I put the #1 or the word Yes?

If it's a checkbox field then the values are as follows.

Yes = 1
No = 0

2. On the flip side, if the user goes in later to update the answer to No, I would want to automatically remove them from the Mailing List and/or user group. Which Auto Acttion would be ideal for a user editing their profile?

Same auto action just invert the action behavior and conditions. So if the value is 1 add the usergroup. If the value is 0 remove the usergroup. Both would be Usergroups auto actions. So to add/remove the newsletters and the usergroups you'd have a total of 4 auto actions. 2 for newsletter and 2 for usergroups.


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.

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
8 months 2 days ago #337933 by AlexRag

1. For Value: 1. Would I put the #1 or the word Yes?

If it's a checkbox field then the values are as follows.

Yes = 1
No = 0


Actually, it's radio buttons, but discovered that the options indicated "Value" so it worked when I added "Yes" to the condition.   I will keep the answer in mind if I later use checkboxes.  

2. On the flip side, if the user goes in later to update the answer to No, I would want to automatically remove them from the Mailing List and/or user group. Which Auto Acttion would be ideal for a user editing their profile?

Same auto action just invert the action behavior and conditions. So if the value is 1 add the usergroup. If the value is 0 remove the usergroup. Both would be Usergroups auto actions. So to add/remove the newsletters and the usergroups you'd have a total of 4 auto actions. 2 for newsletter and 2 for usergroups.

Oh, I got the impression the "onAfterUserRegistration" was only triggered during sign-up.    Will this trigger still work if the user had gone in later on to edit their profile?

Speaking of triggers, are there any docs on the long list of triggers that I can refer to?

Thanks, Kyle!

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

Moderators: beatnantkrileon
Powered by Kunena Forum