Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Auto-Action: How to use different user ?

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago - 11 years 1 month ago #233489 by dotcom22
hello

I need to perform a Post request where the Url contain substitution coming from data entered inside a form planned for CB. For example the url/request look like this:

Url:
Code:
http://api.site.com/http/sendmsg?email=[email]&firstname=[firstname]&lastname=[lastname]


Request:
Code:
Hello [formatname]


Then I need to apply one condition related to a CB field related to user who fire the action. I noticed this is possible using "User" instead to "Automatic" and this work well. The problem in that case is the condition will work but the Url data will be substituted with data of "User" who fire action and not with data entered in the form.

I wondering if is possible to find a solution using other user option such "Specific" and "Manually". I don't understand well how to use these others User Action and if one of them could be useful for my case.

thank

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 1 month ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233511 by krileon
Replied by krileon on topic Auto-Action: How to use different user ?
You can access POST data using [post_VARIABLE]. Also depending on the trigger the user variable is probably in 1 of the 10 variables, but as you did not provide what trigger you're using I can't suggest what variables are available. For future reference you can review the below tutorial for a triggers variables.

www.joomlapolis.com/support/tutorials/120-api-usage/18358-using-cb-triggers

An example of [post_VARIABLE] usage as follows.

[post_cb_field]
[post_username]
[post_name]


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.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago #233539 by dotcom22
Replied by dotcom22 on topic Auto-Action: How to use different user ?
great I tested using [post_cb_field] and this work well :silly:

I still don't understand what are the correspondence of variable1, variable2...and more. IN your tutorial I see all trigger available but nothing else.

For example if I want use onAfterUserRegistration OR onAfterUserUpdate is in relation with a specific variable number ? And why variable are only from 1 to 10 ?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233545 by krileon
Replied by krileon on topic Auto-Action: How to use different user ?

I still don't understand what are the correspondence of variable1, variable2...and more. IN your tutorial I see all trigger available but nothing else.

They're the variables sent by the trigger. If the trigger passes 3 variables then var1-3 can be used to access them.

For example if I want use onAfterUserRegistration OR onAfterUserUpdate is in relation with a specific variable number ?

Check the tutorial link I provided in my previous reply as it provides what variables are sent with what trigger. The numbers are literal left to right. Example as follows

$_PLUGINS->trigger( 'onBeforeUserApproval', array( $row, $approved ) )

With the above $row is var1 ad $approved is var2.

And why variable are only from 1 to 10 ?

No trigger sends more than 10 variables so I don't bother trying to parse for more than 10.


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.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago #233883 by dotcom22
Replied by dotcom22 on topic Auto-Action: How to use different user ?
hello

I have another issue and don't see how to solve it. In fact in my POST request, I need to set email and password of user being registering (and not user who make the action). I configured CB also for auto-generate user password.

So the Request field look like this:

Hello, your email is [post_email] and your password is [password].

This work well for Email but not for password because instead to get the password of new user being registering, I get a very long and unusable password/string who seem to be related to user who make the action. I tested to use [post_password] but this don't work..

How I can do for get the correct password in this case ?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233920 by krileon
Replied by krileon on topic Auto-Action: How to use different user ?
You already are getting the user object of the user being approved. $row is the users object. If User is left on Automatic it'll parse it, determine this is the case, and use it for substitutions. Otherwise you can force it to use Variable 1 or use [var1_email]. You can not get the password at this trigger, it's already encrypted and it's impossible to reverse it. You can only get cleartext password after profile update (if changed), after login, or after registration.


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