<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *
 * @package     [[package名]]
 * @author      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Help_Mail_Done
{
    /**
     * [[機能説明]]
     *
     * @access  public
     */
    var $lg_mail;
    var $actionChain;
    
    var $mail_dev;
    var $url;
    var $mail_text;
    var $username;
    var $mailaddr;
    
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Help_Mail_Doneが実行されました", "Help_Mail_Done#execute");
        
        $this->sendMail();
        return 'success';
    }
    
    function sendMail()
    {
            $mailaddress = ONEDEPO_MAIL;
            if( empty($this->mailaddr) ) {
                $from        = ONEDEPO_MAIL;
            } else {
                $from        = $this->mailaddr;
            }
            
            $params = array("mail_dev"     => $this->mail_dev,
                            "url"          => $this->url,
                            "mail_text"    => $this->mail_text,
                            "username"     => $this->username,
                            "mailaddr"     => $this->mailaddr
                            );

            return $this -> lg_mail -> sendFromTemplate("mail_form", $mailaddress, $from, $params);
    }
}
?>
