My codes works for HTML, on cake_1.2.0.4451alpha
////////////////////////////////
//File controllers/requests.php
////////////////////////////////
class RequestsController extends AppController
{
    var $name = "Requests";
    var $uses = array(...);
    var $components = array('Email');

    function submit($id)
    {
        //save request into database.....
        //then send email alert to manager
        $this->Email->to = $this->data['AuthorizingManager']['mail'];
        $this->Email->from = $this->data['Requestor']['fullname'] . " <".
$this->data['Requestor']['mail'].">";
        $this->Email->replyTo = $this->data['Requestor']['mail'];
        $this->Email->charset = 'utf-8';
        $this->Email->sendAs = "html";
        $this->Email->template = "newRequestSubmit";
        $this->Email->subject = "New Request #".$this->data['Request']['id'].
"comes!";
        $emailResult = $this->Email->send();

        $this->set('request',$this->data);

        $this->flash('Request (#'.$id.') is created! Email Alert ='.
$emailResult, '/requests/view/'.$id);
    }
}

/////////////////////////////////////////////
//File views/layouts/email/html/default.ctp
/////////////////////////////////////////////
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
</head>
<body>
    <div style="background:#ececec;">This test email comes from DCCC</
div>
    <div style="border: 0px solid #888;"><?php echo
$content_for_layout; ?></div>
    <div style="color:red">This E-mail is auto-generated by DCCC</div>
</body>
</html>

////////////////////////////////////////////////////////
//File views/elements/email/html/newRequestSubmit.ctp
////////////////////////////////////////////////////////
Hello, a new request submitted! <br/>
<table style="...">
    <tr style="background: #e0e0e0">
        <td>URL</td>
        <td><a href="http://server/requests/view/<?php echo
$request['Request']['id']?>">http://server/requests/view/<?php echo
$request['Request']['id'] ?></a></td>
    </tr>
    <tr style="background: #ececec">
        <td>Request #</td>
        <td><?php echo $request['Request']['id'] ?></td>
    </tr>
......
</table>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to