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 #234377 by dotcom22
Tested with onStartSaveUserRegistration but no change... I tried also using the code $_POST = 'any@any.com'; and I noticed the value sent to my remote script and stored in his database is simply

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 #234398 by krileon
If it's a format error then adjust the email you're trying to generate so it's in a format your site will accept. It needs to be a valid email format. You can't use first+last@test for example as it has no domain. onStartSaveUserRegistration is the first trigger fired before a registration so it'd be the correct trigger to use.


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 #234473 by dotcom22
Ok I made some more test and I get now some positive result. In fact for work the correct code to use is:
Code:
$_POST['email'] = '[post_firstname][post_lastname]@mydomain.com';

However my goal was to generate my fake email using [user_id] because this value is unique for each user. So I tried this:
Code:
$_POST['email'] = '[post_firstname][post_lastname][user_id]@mydomain.com';

and this:
Code:
$_POST['email'] = '[post_firstname][post_lastname][post_user_id]@mydomain.com';


but none of them work... It seem [user_id] is not yet defined at this stage of registration process. Do you confirm ???

If yes which unique value I could use ?? Maybe is possible to use a session_id (if not too long) or something like that??

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 #234495 by krileon
User ID does not exist at that point so you can't use it. There is no unique value at that point except username and email address. You only get user_id after registration once they're stored in database.


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 #234510 by dotcom22
Username do not work too if using [username] or [post_username] and I think is because in my case Username field is not present/enabled at registration. I chosen also to auto-generate password in CB configuration.

This is annoying because I would like set a kind of short random string just for be sure the generated email will be always different and will never make an error (email already existent/in use). If I set only [firstname][lastname]@mydomain.com, the probability to have one day 2 persons who register with exact same name is high. A simple counter will be enough for get something such:

[firstname][lastname]00001@mydomain.com
[firstname][lastname]00002@mydomain.com
[firstname][lastname]00003@mydomain.com

Have you a suggestion ?

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

I think is because in my case Username field is not present/enabled at registration.

Correct.

This is annoying because I would like set a kind of short random string just for be sure the generated email will be always different and will never make an error (email already existent/in use).

You can try using a CB Query Field and use MD5( RAND() ) to generate a random string. Then substitute in the delimiter field. It may work ok in this situation, but I don't know for sure as never tried it.


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