Skip to Content Skip to Menu

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

Auto-Action: possible to generate email when registering ?

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago #234523 by dotcom22
I tried your suggestion but this don't work.

In fact I'm supposed to see a string output when I look on user profile ?? Probably and in that case I don't see nothing in my delimiter..

Are you sure CB Query Field must contain only MD5( RAND() ) ???

Alternatively I wondering if this was not possible directly in the php code of Auto-Action instead to play with CB field and substitution. In found for example some possibility for do that here:

stackoverflow.com/questions/4356289/php-random-string-generator

Could you take a look if one of these code could be adapted with your CB "fake email" php code ?

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 #234540 by krileon

Are you sure CB Query Field must contain only MD5( RAND() ) ???

No, it still needs to be a valid query. I gave you an example usage of SQL functions to generate a random string. Just querying MD5( RAND() ) will error.

Alternatively I wondering if this was not possible directly in the php code of Auto-Action instead to play with CB field and substitution. In found for example some possibility for do that here:

Yes, you can use PHP functions to generate random strings. Just add uniqid() to it for example.


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 - 11 years 1 month ago #234554 by dotcom22
Ok but could you please give me a valid example query to use ? I don't see how to make this especially because the user is not yet created in the process. I'm supposed for example to specify existent user such myself as Super Admin ?

Otherwise if using PHP function, could you please give me the correct code? The actual code I use in my Action is:
Code:
$_POST['email'] = '[post_firstname][post_lastname]@mydomain.com';

So he could be adapted with something such this:
Code:
$_POST['email'] = '[post_firstname][post_lastname][PHP-CODE]@mydomain.com';

??

Sorry but my sql/coding knowledges are very poor... :blush: :S

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

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 #234560 by krileon

Ok but could you please give me a valid example query to use ? I don't see how to make this especially because the user is not yet created in the process. I'm supposed for example to specify existent user such myself as Super Admin ?

Below should work using purely PHP. As you're already using PHP you won't need a query field or anything of the sort.

Code:
$_POST['email'] = '[post_firstname][post_lastname]' . uniqid() . '@mydomain.com';

Please see the below for further information and usage on uniqid.

php.net/manual/en/function.uniqid.php

Sorry but my sql/coding knowledges are very poor..

For future reference I suggest checking out the below tutorials to get started on learning some PHP and SQL. We do not provide custom coding. Please understand I can not keep giving you functioning examples everytime you need them.

PHP:
www.w3schools.com/php/default.asp

SQL:
www.w3schools.com/sql/default.asp


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 - 11 years 1 month ago #234567 by dotcom22
Excellent this work well :woohoo: :woohoo:
Many thank for this.. :silly:

Please understand I can not keep giving you functioning examples everytime you need them.


I know and I'm sorry for that. I would be very happy to have the time to learn more PHP...but is just impossible because I will need to have one more life for that. When I need something specific (such a CB custom plugin or any thing like that) I hire a developer for make the job...but when is matter to get a small thing like that is a bit difficult. I will be happy to pay a fee for any little custom code related to CB I could ask...but I know for you is not matter of money but probably more matter of time. It would be a great thing to have a person of your team (or a CB partner/coder) who could help for this kind of little thing in exchange of a fee... I'm sure around here some of your customers could be interested in a service such this one..



Please a last thing:

I still get a problem and I don't see how to solve this. I spend more than 2 hours by playing with CB conditional for get desired result but without success..

I resume a bit:

I have a registration form composed of:

- First name
- Last name
- Email
- Phone
- Birth date

With Auto-Action and your solution I can generate a fake email for the case where a user cannot provide an address. But when he can, is necessary to not fire the action otherwise instead to register with his own email he will get a fake email. So the only solution I found is to create a new Radio field Yes/No "Can you provide an Email address??". Then I applied a condition to my action for fire only if Radio field value is equal to No. For be logic, I setup also CB Conditional field for hide Email field if Radio field is ticked to NO (this of course for avoid confusion). But with this last condition I get again a "format error" and I can't register... If I remove the condition (that mean email field is visible even if user ticked No), I can register without problem...

It seem the "hide email field" condition broke the process. I tried a bunch of different single or multiple conditions (self or other) in one/two way but nothing change and when I choose to hide email field, I get an error and the process is interrupted.

For what I understood, your code is included directly in the Post request onStartSaveUserRegistration so it seem to me strange is required to show Email field even if in practice no value are entered inside by user. I don't know how CB Conditional work with show/hide function (based of CSS display:none ?) but it seem his task is not only to hide but also to more less disable the field...

Have you a solution for this ?

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

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 #234585 by krileon

but I know for you is not matter of money but probably more matter of time.

It truly is a matter of time unfortunately.

It would be a great thing to have a person of your team (or a CB partner/coder) who could help for this kind of little thing in exchange of a fee... I'm sure around here some of your customers could be interested in a service such this one..

We're already gathering a list of recommended developers. Hopefully after awhile we'll have enough that we can confidently suggest someone anytime anyone needs custom coding.

With Auto-Action and your solution I can generate a fake email for the case where a user cannot provide an address. But when he can, is necessary to not fire the action otherwise instead to register with his own email he will get a fake email. So the only solution I found is to create a new Radio field Yes/No "Can you provide an Email address??". Then I applied a condition to my action for fire only if Radio field value is equal to No. For be logic, I setup also CB Conditional field for hide Email field if Radio field is ticked to NO (this of course for avoid confusion). But with this last condition I get again a "format error" and I can't register... If I remove the condition (that mean email field is visible even if user ticked No), I can register without problem...

I wouldn't even bother with CB Conditional usage in this situation. Just set your Email field as non-Required then in your Auto Action add a conditional as follows.

[post_email] Is Empty

This way it doesn't bother doing anything if they supplied an email address. If they left it blank your action should work and generate them one.

but it seem his task is not only to hide but also to more less disable the field...

Correct, if it functioned only on a display level it'd be a vulnerability. It stops the post value from ever storing to prevent this.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum