Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

Auto Actions - how can I do this?

  • gvaneijk
  • gvaneijk
  • OFFLINE
  • Posts: 23
  • Thanks: 2
  • Karma: 1
11 years 9 months ago #223998 by gvaneijk
Auto Actions - how can I do this? was created by gvaneijk
I recently signed up as a professional member to aqcuire CB Auto Actions. It seems like a I-can-do-it-all plugin and I'm not sure how to configure it. I've seen some use cases but it's a bit of guesswork for me.

I want to do 2 things with it.

1) I want the username to be a member's mail adres instead. So when they register the email adress should be saved as the username. I read that CB Auto Actions can do this and I think I'm fairly close. I've got the following:

Type: Field
Trigger: onStartSaveUserRegistration
User: Automatic
Field action:
Field: Username
Operator: Set(Field = Value)
Value: ???

If this is corret all I need is the email value, but I'm not sure where to find this.


2) If this is possible, I'd like to send a setdata call to another plugin when someone changes their email adress, is this possible? If so, how can I achieve this?

Thanks in advance!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48700
  • Thanks: 8317
  • Karma: 1447
11 years 9 months ago - 11 years 9 months ago #224015 by krileon
Replied by krileon on topic Auto Actions - how can I do this?

1) I want the username to be a member's mail adres instead. So when they register the email adress should be saved as the username. I read that CB Auto Actions can do this and I think I'm fairly close. I've got the following:

Your current setup is correct except you need to use the after registration trigger and Value should be email substitution.

2) If this is possible, I'd like to send a setdata call to another plugin when someone changes their email adress, is this possible? If so, how can I achieve this?

Create a new action of type Code then use the after registration trigger (same as your first action), but ensure this action is ordered after your action that changes username. Now set method to PHP (create_function) and you can supply whatever PHP you need to call your other plugin.


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: 11 years 9 months ago by krileon.
The following user(s) said Thank You: gvaneijk

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

  • gvaneijk
  • gvaneijk
  • OFFLINE
  • Posts: 23
  • Thanks: 2
  • Karma: 1
11 years 9 months ago #224022 by gvaneijk
Replied by gvaneijk on topic Auto Actions - how can I do this?
Krileon, many thanks for your reply!

The username field now contains the email adress correctly.
However the username can still be changed in the profile edit, is there any way I can prevent this? I really only want my users to see and possibly edit the email adres but not the username.


For the second part, would the trigger here be 'onAfterUserUpdate'? Or at least I would figure that is the trigger that happens when someone changes anything on their profile, is that correct?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48700
  • Thanks: 8317
  • Karma: 1447
11 years 9 months ago #224025 by krileon
Replied by krileon on topic Auto Actions - how can I do this?

However the username can still be changed in the profile edit, is there any way I can prevent this?

You can disable this within CB > Configuration > User Profile.

For the second part, would the trigger here be 'onAfterUserUpdate'? Or at least I would figure that is the trigger that happens when someone changes anything on their profile, is that correct?

Yes, you'd use the after profile update trigger.


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: gvaneijk

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

  • gvaneijk
  • gvaneijk
  • OFFLINE
  • Posts: 23
  • Thanks: 2
  • Karma: 1
11 years 9 months ago - 11 years 9 months ago #224522 by gvaneijk
Replied by gvaneijk on topic Auto Actions - how can I do this?
EDIT: Nevermind it was another issue that was in the way! I had a duplicate test account with the same mail adress :blush:

Another question about this.

Because the username gets set as email adress on registration, ofcourse I want to keep it as their upto-date mail adres even when someone changes their mail adress.

So I made an auto action onAfterUserUpdate to change the username to the mailadress, incase someone would change their mailadress. However, when I save my profile without changing anything it also runs that auto action and says 'email already in use'.

How can I prevent the auto action from running if the email adress hasn't changed?
Last edit: 11 years 9 months ago by gvaneijk. Reason: Solved!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48700
  • Thanks: 8317
  • Karma: 1447
11 years 9 months ago #224552 by krileon
Replied by krileon on topic Auto Actions - how can I do this?
You can check that it has changed by comparing var1 email to var3 email. var1 contains the new user object and var3 contains the old user object. So for example you'd have the below conditional.

[var1_email] Not Equal To [var3_email]


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