Disabling sending of the confirm email

7 years 2 months ago #291584 by AchLive
Hi, I want to know how to disable the sending of the registration confirmation email if a field of the registration form has a certain value.
Example: in the registration form I have a field named key, if key is equal to 1 then the confirmation e-mail should not be sent.
I think that can be used CB AutoAction but I tried different trigger and I can not do it
Let me know if it is possible
Thanks for the support

Please Log in to join the conversation.

7 years 2 months ago #291605 by krileon
Replied by krileon on topic Disabling sending of the confirm email
You'll likely have to modify the user object by reference in a code action before they're registered to do that. Something like the below might work.

Global
Triggers: onBeforeUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$vars['var1']->confirmed	=	1;

if ( ( $vars['var1']->confirmed == 1 ) && ( $vars['var1']->approved == 1 ) ) {
	$vars['var1']->block	=	0;
}
Parameters
Reference Variables: Variable 1

Add whatever conditions necessary under the conditions tab, but I recommend testing without conditions first to see if it even works.


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 to join the conversation.

7 years 1 month ago - 7 years 1 month ago #291707 by AchLive
Replied by AchLive on topic Disabling sending of the confirm email
Thanks krileon, the code works. The email to confirm registration is not sent. Send though the confirmed registration email. I also want to block this email. How would I change the code?
I also want to better understand the management of variables. Where can I see a manual or tutorial on this subject?
I would also like to know how to set the "Return" parameter, I have left "echo"
Thanks for the support

Please Log in to join the conversation.

7 years 1 month ago #291714 by krileon
Replied by krileon on topic Disabling sending of the confirm email

Thanks krileon, the code works. The email to confirm registration is not sent. Send though the confirmed registration email. I also want to block this email. How would I change the code?

The confirmation email does or does not send? Sorry, confused by this as you said it's not sent, but is sent?

I also want to better understand the management of variables. Where can I see a manual or tutorial on this subject?

Documentation on trigger variables can be found below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers

I would also like to know how to set the "Return" parameter, I have left "echo"

There is no return during that trigger unless an error occurs. Return in this case should be set to Silent.


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 to join the conversation.

7 years 1 month ago #291723 by AchLive
Replied by AchLive on topic Disabling sending of the confirm email

The confirmation email does or does not send? Sorry, confused by this as you said it's not sent, but is sent?

The first email, the one with the link to confirm, was blocked. I want to lock the second email, one that confirms the completed registration whose object (YOUR_REGISTRATION_IS_APPROVED_SUBJECT)
Thank you

Please Log in to join the conversation.

7 years 1 month ago #291726 by krileon
Replied by krileon on topic Disabling sending of the confirm email
The usage provided causes the user to be automatically confirmed. This results in the Welcome email (e.g. YOUR_REGISTRATION_IS_APPROVED_SUBJECT) being sent as their registration is completed since no admin approval is enabled. Are you wanting them even confirmed or are just purely trying to stop the emails?

There's no means to stop the emails through any of the available triggers. The emails however will not send if the subject and message is empty so you maybe able to use IF conditions within a language override of the language strings for the emails to result in empty subject and body based off various conditions.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.167 seconds

Facebook Twitter LinkedIn