Skip to Content Skip to Menu

[SOLVED] Lost password email template and redirect with Auto Action

11 years 9 months ago - 10 years 7 months ago #218845 by DreiBundeinA
Hello,

I have a little problem with the "Lost password" function in CB. I use Joomla 2.5.8 and CB 1.9.

When the user has requested a new password, he got a little system message. Also the email which is fired out is really boring, as it is just styled through the language file.
  1. It is there a way to redirect with Auto Action (plugin) the user after he has requested a new password to an own little "Thank you"-page?
  2. Also is it possible to create via the Auto Action an own email template for the new password?

It would be really great, if someone could help me.
Thanks.


Regards from Munich, Germany
Tom

Just creating a new site...
Last edit: 10 years 7 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
11 years 9 months ago #218861 by krileon

It is there a way to redirect with Auto Action (plugin) the user after he has requested a new password to an own little "Thank you"-page?

Unfortunately I don't think you can without breaking the storage process and stopping the notification. All the triggers in sendNewPass for password change happen before new password is stored and notification is sent. You can try editing comprofiler.php and change the redirect URL if you like, but can't help you in this regard as we don't support core edits.

Also is it possible to create via the Auto Action an own email template for the new password?

Same issue as above, but you shouldn't need to as you can customize it using the reminder language defines as follows.

Subject = _UE_NEWPASS_SUB
Body = _UE_NEWPASS_MSG


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.

11 years 9 months ago #218897 by DreiBundeinA
Hmm, that'S too bad.
I made now a core hack for the redirect. As I don't see any other solution.
Below is a snippet of the code out of comprofiler.php (line 885 - 919)
Code:
$user_id = $_CB_database->loadResult(); if ( ! $user_id ) { cbRedirect( cbSef( 'forgotten-password.html' ), _ERROR_PASS ); } $newpass = cbMakeRandomString( 8, true ); // should be $user->setRandomPassword() but as this whole function needs to be redone to require clicking link for new password change, let's leave it for now. $message = str_replace( '\n', "\n", sprintf( _UE_NEWPASS_MSG, $checkusername, $_live_site, $newpass ) ); $subject = sprintf( _UE_NEWPASS_SUB, $checkusername ); $_PLUGINS->trigger( 'onBeforeNewPassword', array( $user_id, &$newpass, &$subject, &$message )); if ($_PLUGINS->is_errors()) { cbRedirect( cbSef("index.php?option=$option&task=lostPassword".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), $_PLUGINS->getErrorMSG(), 'error' ); return; } $_PLUGINS->trigger( 'onNewPassword', array($user_id,$newpass)); $user = CBuser::getUserDataInstance( (int) $user_id ); $user->password = $newpass; if ( ! $user->storePassword() ) { cbRedirect( cbSef("index.php?option=$option&task=lostPassword".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), $user->getError(), 'error' ); return; } else { $cbNotification = new cbNotification(); $res = $cbNotification->sendFromSystem($user_id,$subject,$message); if ( ! $res ) { cbRedirect( cbSef("sign-in-or-book-your-collection.html"),_UE_NEWPASS_FAILED ); return; } } cbRedirect( cbSef("sign-in-or-book-your-collection.html"), sprintf( _UE_NEWPASS_SENT, htmlspecialchars( $confirmEmail ) ) ); } else { cbRedirect( cbSef("sign-in-or-book-your-collection.html"), _UE_NEWPASS_FAILED );

But for the email I don't get a solution. With the language defines I can't integrate a whole HTML Email template. That's too crazy. Any other solution?
Thanks a lot.

Just creating a new site...

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
11 years 9 months ago #218915 by krileon
You can use HTML in the defines, just make sure you escape your quotes. If I recall correctly only the pending and welcome registration emails are hardcoded for text only. If still not working you can adjust the sendFromSystem usage to allow html and it'll then work.


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.

10 years 7 months ago #243293 by prestoproducts
I am trying to send an HTML email message for the password request as you have noted in this thread. I have tried to place HTML tags in the message output, but those tags are written into the message.

This leads me to believe that I need to adjust the sendFromSystem to allow HTML. Can you please post the steps to set the sendFromSystem to allow HTML?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #243299 by krileon
Welcome and Pending emails don't support HTML in 1.x. CB 2.x supports HTML in both. You'll need to edit sendFromSystem and change $mode to always be 1 and CB will always send system emails with HTML.


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