Hey Michael,

Within your afterSave() function you still have access to the
$controller->data array just like you do in your other controller
actions / functions.

i.e.

function editBookmark() {

    if (!empty($this->data)) {

        // save stuff

    } else {

        // display stuff

    }

}

so, similarly in your afterSave function you could:


function editBookmark() {

    $msg = 'Bookmark title was: ' . $this->data['Bookmark']['bookmark_title'];

    mail('[EMAIL PROTECTED]', 'Bookmark saved to database',$msg);

}

you might also want to look in to:

http://wiki.cakephp.org/tutorials:sending_email_with_phpmailer

hope this helps,
mike

On 24/09/06, michael234 <[EMAIL PROTECTED]> wrote:
>
> Hi, I've read that you can automatically generate an email after saving
> a form like below...
>
> function afterSave()
>         {
>                 // mail me when a new bookmark is added
>                 mail('[EMAIL PROTECTED]', 'Bookmark saved to database');
>                 return true;
>
> But what im wondering is how do you add the feilds of the form you have
> just submitted to the email and is it still all done in the model?
>
> Thanks,
> Michael.
>
>
> >
>

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

Reply via email to