Skip to Content Skip to Menu

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

Different TY message depending on field selection on registration form

  • sarkomand
  • sarkomand
  • OFFLINE
  • Posts: 9
  • Thanks: 1
  • Karma: 0
8 years 7 months ago #278603 by sarkomand
Hello.

Is it possible to display a different message after registration depending on the option selected in a dropdown field?

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 7 months ago - 8 years 7 months ago #278607 by krileon
The message isn't passed through substitutions so you won't be able to substitute anything into those languages, but the below usage in CB Auto Actions may work.

Global
Triggers: onAfterSaveUserRegistration
Type: Code
User: Automatic
Access: Everybody
Conditionals
1: [FIELD_NAME] Equal To FIELD_VALUE
Action
Method: PHP
Code:
Code:
$vars['var2'][] = 'MESSAGE_HERE';
Return: Silent
Parameters
References: Variable 1 and Variable 2

If that doesn't work you could use a return usage to just echo a message on the page or using Message method to add a message to the message queue.


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

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

  • sarkomand
  • sarkomand
  • OFFLINE
  • Posts: 9
  • Thanks: 1
  • Karma: 0
8 years 7 months ago #278642 by sarkomand
Thank you, it worked.

Is there a way MESSAGE_HERE can be a language string so it can be translated?

Also, would it be possible in a similar manner to have different email messages sent to user and/or admin?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 7 months ago #278667 by krileon

Is there a way MESSAGE_HERE can be a language string so it can be translated?

Yes, you need to pass it through CBTxt for that. Example as follows.

Code:
$vars['var2'][] = CBTxt::T( 'MESSAGE_HERE' );

Now you should be able to add a language translation for it to your language files as follows.

Code:
'MESSAGE_HERE' => 'MESSAGE_HERE_TRANSLATED',

Also, would it be possible in a similar manner to have different email messages sent to user and/or admin?

Pending and Welcome emails support substitutions so you can adjust those through CB > Configuration > Registration as needed. The admin new registration email I believe also supports substitutions, but you need to modify the language string for that.

If you just want to send new emails all together then yes you'd just use an Email action on the onAfterUserRegistration 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: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum