Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, March 29, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Send a notify email to new user with username and password

phpMyEdit Features     Send a notify email to new user with username and password
Post new topic   Reply to topic    
 
smokinpuppy     Joined: 26 Mar 2012   Posts: 14  
Post Posted: 2012-06-17 09:49
Back to top  Reply with quote     

Hi,

I would like to be able to send a notification email to a new user when they are added and then if their record is changed I would like to send another notification with the new info. I know that other people have posted this, but the password field is encrypted when it is inserted into the database, so if I send them the email the password would be encrypted so would not be usable. Is there a way to send the email before the record is created and the password is encrypted?

Thank you in advance,

Robert

 
smokinpuppy     Joined: 26 Mar 2012   Posts: 14  
Post Posted: 2012-06-17 11:13
Back to top  Reply with quote     

I figured it out, I modified the code in this thread:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=1113&highlight=notify+email

Thank you zucarino :).

1) Create the Mail Notify file email_notify_RYH.php , something like this:
Code:
<?php
// Show message:
echo "<span style='background-color: #FEFFE6'>Record $this->rec updated!</span>";

//----- Send Notification Email to New or Updated Control Panel User ----->
$name = "Some_Name";
$from = "from_email@yourweb.com";
$to = $newvals['email'];
$subject = "New/Updated User Information";
$message = "<html>
   <head></head>
      <body> 
         <table border='0' cellpadding='0' cellspacing='0' align='center' width='550'>
            <tr><td><img src='images/emailheader.jpg' alt='alttxt'><br><br></td></tr>
            <tr><td>Dear ".$newvals['fname'].",<br><br>Here is your User Information:<br>";
                foreach($newvals as $key => $val){
                     $message .= "<b>" . $key . " : </b>" . $val . "<br />";
                }
            $message .= "<br>Best regards,<br>Some Signature<br><br>";
            $message .= "<tr><td><img src='images/emailfooter.jpg' alt='alttxt'><br><br></td></tr>
              </table>
             </body>
   </html>";
      
// Setup Headers
"--{$mime_boundary}--\n";
$headers = "From: $name<$from>" . "\n";
$headers .= "Reply-To: $from"."\n";
$headers .= "Return-Path: $from" . "\n";
$headers .= "Date: ".date("r")."\n";
$headers .= "MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1 \n";
      
// Send it
if (mail($to, $subject, $message, $headers)) {
   echo(" Mail sent!");
} else {
   echo(" Mail delivery failed");
}

?>


2) Add these lines on your PME file to use the trigger (before the line who calls the PME Class):

Code:
Code:
$opts['triggers']['insert']['before']  = 'include/email_notify_RYH.php';
$opts['triggers']['update']['before']  = 'include/email_notify_RYH.php';


3) Test...

Best regards!

 
LauraPPowell     Joined: 01 Jun 2021   Posts: 1  
Post Posted: 2021-06-01 14:29
Back to top  Reply with quote     

I heard a lot about this platform and it is good. I want to use it and from the https://assignmentman.co.uk/research-paper/ I search for the best ideas and it helps me a lot to learn more about this site.

 
charlottejohn     Joined: 28 Apr 2020   Posts: 29  
Post Posted: 2022-05-14 11:59
Back to top  Reply with quote     

are always try to worried about the free stock picture which will they use in their project commercially. Try to get register all these forums academic writing services UK

 
willamson     Joined: 07 Mar 2022   Posts: 25  
Post Posted: 2022-05-18 13:46
Back to top  Reply with quote     

The article has actually peaks my interest. I am going to bookmark your website and preserve checking for brand new information term paper writing services UK

 
Conyjohn     Joined: 06 Mar 2021   Posts: 58  
Post Posted: 2022-06-22 13:42
Back to top  Reply with quote     

This Educational conference is good and I really learn a lot from here, I get detailed info on courses, placement best research paper service uk

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy