Customer information mail

Discussion in 'General' started by dvazart, Feb 29, 2008.

  1. dvazart

    dvazart New Member

    Hi !
    I go directly to the topic:

    In my company when we make a new customer account (and hosting) we have to write an E-mail with all the info about the new site-user like: user names, e-mails, FTP path, and passwords.

    Actualy we make this e-mail by hand but is realy boring, so, i want to make a php script to auto generate this e-mail using the ispconfig database... the big problem is: im not a developer, so, this task is really hard for me :(

    Now i have a little php script and a "idea" of the MySQL query to generate the e-mail, but, i have something wrong in the query and the information displayed is not the correct.

    Code:
    <?
            function traerDatos(){
                    $link = mysql_connect("localhost","root","xxxxxxx");
                    mysql_selectdb("db_ispconfig",$link);
    
    //              $resultado = mysql_query("",$link);
                    $resultado = mysql_query("SELECT isp_isp_web.web_host, isp_isp_web.web_domain, isp_isp_user.user_name, isp_isp_user.user_username, isp_isp_user.user_email, isp_i
    sp_user.user_admin, isp_isp_user.doc_id, isp_isp_web.doc_id FROM isp_isp_web, isp_isp_user WHERE isp_isp_web.doc_id = isp_isp_user.doc_id and isp_isp_user.user_admin = 0",$link)
    ;
    
                    $tabla = "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
                    $tabla .="  <tr>";
                    $tabla .="    <td>WEB HOST</td>";
                    $tabla .="    <td>WEB DOMAIN</td>";
                    $tabla .="    <td>NAME</td>";
                    $tabla .="    <td>USERNAME</td>";
                    $tabla .="    <td>USER EMAIL</td>";
                    $tabla .="    <td>USER ADMIN</td>";
                    $tabla .="    <td>USER DOC ID</td>";
                    $tabla .="    <td>WEB DOC ID</td>";
                    $tabla .="  </tr>";
    
    
                    while ($row = mysql_fetch_array($resultado)) {
                            $wb = $row[0];
                            $webdom = $row[1];
                            $name = $row[2];
                            $username = $row[3];
                            $userEmail = $row[4];
                            $userAdm = $row[5];
                            $userDoc = $row[6];
                            $webDoc =  $row[7];
                    
    
                            $tabla .="  <tr>";
                            $tabla .="    <td>$wb</td>";
                            $tabla .="    <td>$webdom</td>";
                            $tabla .="    <td>$name</td>";
                            $tabla .="    <td>$username</td>";
                            $tabla .="    <td>$userEmail</td>";
                            $tabla .="    <td>$userAdm</td>";
                            $tabla .="    <td>$userDoc</td>";
                            $tabla .="    <td>$webDoc</td>";
                            $tabla .="  </tr>";
                    }
     }
    
                    $tabla .="</table>";
    
                    mysql_free_result($resultado);
                    mysql_close($link);
    
                    return $tabla;
    
                    
            }
    ?>
    
    Can you help me please ??

    Note: sorry, i know my english is not very good.
    Note 2: THANK YOU in advance !!!
     
  2. falko

    falko Super Moderator Howtoforge Staff

    This functionality is already built-in into ISPConfig.
    The admin can set up welcome messages under Management > Server > Settings, and the resellers can do this on their Options tab.
    If you have filled in a valid email address for the client and also for the reseller/admin, the system sends welcome emails automatically.
     
  3. dvazart

    dvazart New Member

    Great !!!
    i will try it !!

    thanks.
     

Share This Page