Can CB send confirmation email, but no "welcome" email? Asking for a friend. :-)

3 years 4 months ago - 3 years 4 months ago #322158 by bascherz
Using that has to be done in content where Joomla content preparation is supported, right? Or is the only place it is parsed in the text box entered in the CB registration configuration? Is there any way I can just get the link (e.g., a PHP method) by providing the user_id?

I need it in an Auto Action triggered off onAfterUserRegistration. It is not working in a PHP Code Auto Action using either [confirm] or [confirmlink] via the usual substitution. My code does the below and then the included file's code uses the value of $confirmlink.

$confirmlink = '[confirm]';

or

$confirmlink = '[confirmlink]';

Neither worked. I just get those strings. Also, is there an Auto Action trigger for RESENDING the Confirmation email? I need that to trigger this AA also.

What I am trying to do here is use articles as HTML email templates that my admin staff can customize without going into the site back end. Currently, the only way to get those messages to look like they want them is for them to change the article (template), and then have me copy and paste that HTML into the CB registration config box. Is that the only option here? The Auto Action is sending the email fine onAfterUserRegistration, but I need to get that confirmation link into it through the Auto Action. Is this a futile effort?

Thanks!
Bruce

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

3 years 4 months ago - 3 years 4 months ago #322161 by bascherz
Ah ha! Found the answer here!

www.joomlapolis.com/forum/146-general/239038-actual-place-for-the-hyperlink-sent-by-confirmation-email#304156

But that's not actually the best link anymore. It's this one now.
$link = "DOMAIN_NAME/profile/confirm?confirmcode="$user->cbactivation;

My other question still stands. How can I use the User Management Resend Confirmation to trigger this Auto Action, which works perfectly now when triggered onAfterUserRegistration? Or, is there another way to trigger a particular Auto Action for a specific user?

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

3 years 4 months ago #322169 by krileon
The [confirm] substitution won't work in CB Auto Actions. You'll have to format the URL yourself using the below.

index.php?option=com_comprofiler&view=confirm&confirmcode=[cbactivation]

Why are you replacing CBs normal confirmation email flow? I do not recommend doing this.

My other question still stands. How can I use the User Management Resend Confirmation to trigger this Auto Action, which works perfectly now when triggered onAfterUserRegistration? Or, is there another way to trigger a particular Auto Action for a specific user?

You can't. There's no triggers for the resend confirmation button in CB > User Management.


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.

3 years 4 months ago #322175 by bascherz
I had a feeling you'd ask me that. It's because my client wants to control what the emails look like. I have an email template system in place that allows them to edit articles with placeholders to insert information from our user database. Using the built-in CB message method, they have no access to the layout of these messages, so I have to circumvent the built-in system to support them being able to edit them (without back end access). I know, it's an unusual situation, but that's what I am dealing with.

Since I do now have a working confirmation email sending method, I can write a small module that allows me to resend any one that is still sitting in the database. I figured I might have to do this, and I will make it simple (one by one), but I do need this occasionally.

The other thing I didn't know existed until today is CB will try to resend the confirmation email if the user tries logging in before clicking the link in that email. Of course, those emails aren't being sent either. Is there an event for when that occurs?

Thanks for understanding, Kyle. I really need to get this working.

Bruce

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

3 years 4 months ago #322184 by krileon
CB was not designed for the confirmation email to be overridden like that. The only thing I can think of is to act on the global email trigger onBeforeSendEmailMSG and modify the email process. That trigger is fired for all output emails and contains the following variables.

$_PLUGINS->trigger( 'onBeforeSendEmailMSG', array( $this, &$toUser, &$fromUser, &$subject, &$message, &$addPrefix, &$mode, &$cc, &$bcc, &$attachment ) );

All variables prefixed with & are sent by reference. This means they can be set as Reference Variables in CB Auto Actions and modified in a Code action. Example as follows would modify the subject of an email.

Action
Method: PHP
Code:
$variables['var4'] = 'MY NEW SUBJECT!';
Parameters
Reference Variables: Variable 4

You would need to condition the subject or body to determine if it's the confirmation email. Be careful with that trigger as it's applied to all outbound CB emails. This would likely be the best way to override the confirmation email message with your templating code instead of trying to replace the confirmation email process with your own.

The other thing I didn't know existed until today is CB will try to resend the confirmation email if the user tries logging in before clicking the link in that email. Of course, those emails aren't being sent either. Is there an event for when that occurs?

No, there is not a way to modify that either beyond the above usage.


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.

3 years 4 months ago #322187 by bascherz
OK, that's probably the most complete answer I am going to get on this subject. I am going to think on it a while because one part of this whole email templates concept is that the title of the article becomes the subject of the email. So I can't trigger on that. I will have to trigger on something else, and that's just not coming to me unless it's a code embedded in some javascript in the message or something.

Thanks, Kyle. You are freakin' awesome, my friend!

Bruce

______________________
Bruce S - Vienna, VA

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.416 seconds

Facebook Twitter LinkedIn