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

1 week 4 days ago - 1 week 2 days 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?

 

Please Log in to join the conversation.

1 week 4 days ago - 1 week 4 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.
The following user(s) said Thank You: AlexRag

Please Log in to join the conversation.

1 week 4 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 to join the conversation.

1 week 3 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 to join the conversation.

1 week 3 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 to join the conversation.

1 week 3 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.319 seconds

Facebook Twitter LinkedIn