Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > osTicket 1.6.x > General Discussions

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-13-2012, 10:23 AM
calidris calidris is offline
Junior Member
 
Join Date: Apr 2012
Posts: 2
Question Mail a new user

Hi,

Is it possible to automatically send an email to a new user, with a link to the login page, his/her username and password, when that user is created?

If so, how?

Thank you in advance.
Reply With Quote
  #2  
Old 04-16-2012, 07:38 AM
equisde equisde is offline
Member
 
Join Date: Jan 2012
Location: Madrid - Spain
Posts: 165
Default

Hello,

Yes. My modification to do it:

in scp/admin.php (around line 405)

PHP Code:
case 'staff':
        include_once(
INCLUDE_DIR.'class.staff.php');
        
$do=strtolower($_POST['do']);
        switch(
$do){
            case 
'update':
                
$staff = new Staff($_POST['staff_id']);
                if(
$staff && $staff->getId()) {
                    if(
$staff->update($_POST,$errors))
                        
$msg='Perfil de miembro actualizado con éxito';
                    elseif(!
$errors['err'])
                        
$errors['err']='Error al actualizar miembro';
                }else{
                    
$errors['err']='Error interno';
                }
                break;
            case 
'create':
             
/*   if(($uID=Staff::create($_POST,$errors)))
                    $msg=Format::htmlchars($_POST['firstname'].' '.$_POST['lastname']).'Agregado con éxito ';
                elseif(!$errors['err'])
                    $errors['err']='No se ha podido agregar al miembro. Intentalo de nuevo';*/
                    
                    
                
if(($uID=Staff::create($_POST,$errors))) {
                    
$msg=Format::htmlchars($_POST['firstname'].' '.$_POST['lastname']).' added successfully';
                    
$helpdesk_email=$cfg->getDefaultEmail();
                    
$helpdesk_url=$cfg->getUrl();
                    
$helpdesk_title=$cfg->getTitle();
                    if(
$helpdesk_email){
                       
$helpdesk_email->send($_POST['email'], 'Your New Account'
  
''.$_POST['firstname'].',
 
  We have just created you a new account on '
.$helpdesk_title.':
 
  Please find below your account details:
 
  Username: '
.$_POST['username'].
  Password: '
.$_POST['npassword'].'
 
  You may login now from http://XXXXXXXXX.com
  
  The system will ask you for changing your password the first time you log on the website.
 
  Please keep this email securely for your archive.
  
  XXXXXXX Support Desk'
);
                    }  
                } elseif(!
$errors['err']) {
                    
$errors['err']='Unable to add the user. Internal error';
                }
    
                break; 
Reply With Quote
  #3  
Old 04-16-2012, 07:54 AM
calidris calidris is offline
Junior Member
 
Join Date: Apr 2012
Posts: 2
Default

It works like a charm.
Thank you very much.
Reply With Quote
  #4  
Old 04-16-2012, 09:00 AM
equisde equisde is offline
Member
 
Join Date: Jan 2012
Location: Madrid - Spain
Posts: 165
Default

You're welcome!
Reply With Quote


Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:01 AM.