Auto actions email to specific user group on registration

4 years 2 months ago #316636 by softforge
Hi
I have used the really helpful documentation here
www.joomlapolis.com/documentation/279-community-builder/tutorials/18362-registering-a-user-through-cb-api
to register users via salesforce and who are coming via an external table into a VIP members group.

That works great.
But I want a specific registration details email message for this user group.
If I change the email in the CB settings configuration->registration tab
That will apply to all the user groups and not just to the ones I am adding via this script. Joe public still needs to register as using that, so how can I send an email to just this user group, call them "VIP Members" that are registered via the script?

I could I guess use auto actions, but which action would fire if I used the script to register them?

I could do it via the script that I have written if auto actions cannot do that but the other question that applied to both is how can I stop the generic registration that I currently get from being sent? Other wise they will get the configuration->registration tab one and the auto actions/my script one

Thanks

Phil

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

4 years 2 months ago #316641 by krileon
Registration emails are sent in activateUser. Probably easiest way to override them is to temporarily override the configuration global for those emails. Example of how to do this as follows.

global $ueConfig;

$existingPending				=	$ueConfig['reg_pend_appr_msg'];
$existingWelcome				=	$ueConfig['reg_welcome_msg'];

$ueConfig['reg_pend_appr_msg']	=	'NEW_PENDNG_EMAIL';
$ueConfig['reg_welcome_msg']	=	'NEW_WELCOME_EMAIL';

$messagesToUser					=	activateUser( $user, 1, 'UserRegistration' );

$ueConfig['reg_pend_appr_msg']	=	$existingPending;
$ueConfig['reg_welcome_msg']	=	$existingWelcome;

Both the pending and welcome configuration are sent through translations so you can just specify a language key in the replacement then translate them using language overrides.


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.

4 years 2 months ago #316664 by softforge
Thanks for the reply.
I am lost as to where I am doing this.
" temporarily override the configuration global "

Where would I do this? In my script as I cycle through each new registration? Or somewhere else?

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

4 years 2 months ago #316666 by krileon
In your script. If you followed the tutorial you should have the below.

$messagesToUser			=	activateUser( $user, 1, 'UserRegistration' );

My above reply provides a way to override the emails configured in CB > Configuration > Registration specifically for that usage and then reverts the change. You can override pending, welcome, or both emails.


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.

4 years 2 months ago #316679 by softforge
Fantastic. I will give that a go and let you know how it works.

many thanks

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.546 seconds

Facebook Twitter LinkedIn