tags:

views:

36

answers:

3

Hello all

I am trying to send mail using CakePHP in-built Email component. When I send the mail, there is this footer [This email was sent using the CakePHP Framework: http://cakephp.org]. How can I lose that?

Regards

+2  A: 

It can be modified from app/views/layouts/email/text/default.ctp and app/views/layouts/email/html/default.ctp.

James Skidmore
I am already using a template for sending mail and it does not have Cakephp mentioned in it. Its not named default.ctp however. I am setting the template option in controller like this: $this->Email->template = "enquiry";
ShiVik
@James - I think you meant cake/libs/view/layouts/email/text/default.ctp and cake/libs/view/layouts/email/html/default.ctp
ShiVik
@ShiVik,so where do you put your own template?
SpawnCxy
@ShiVik,you may need to put your own templates where James said,**not** `cake/libs/view/layouts/email/html/`
SpawnCxy
I put my templates where James app/views/layouts/email/text/default.ctp and app/views/layouts/email/html/default.ctp. But the Cakephp footer I am talking about is there in the template in cake/libs/view/layouts/email/text/default.ctp. So I am guessing I need to remove it. or is there a better way?
ShiVik
no,you needn't remove it.
SpawnCxy
@SpawnCxy - So how do I get rid of it in the mail? I don't have it in my template, but its still appearing in the mail I send.
ShiVik
@ShiVik,i've made an answer for this.
SpawnCxy
@SpawnCxy - missed that one :). Didn't see that scrollbar on my tiny screen. Thanks. :)
ShiVik
+2  A: 

If you've set

$this->Email->template = "enquiry";

Then you need to make the template named 'enquiry.ctp' in app/views/layouts/email/text/ and app/views/layouts/email/html/ as below:

text template:

<?php echo $content_for_layout; ?>

html template:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
    <?php echo $content_for_layout; ?>
</body>
</html>
SpawnCxy
A: 

No, you don't remove the original file, you just override it by posting a file of the same name in the appropriate place (which will differ from where the file is located within the core cake files (i.e. cake/libs), I think in this case it just goes in the place SpawnCxy said, just use the same name as the file you are trying to override.

Rick