-1

In my script i have a folder /mail and i'm storing my mail text in this folder. And now i have more than 10 mail text. And i decided to create a mail footer. Because i'm copying every lines to other mail text. When i want to make change it is hard for me.

I created a mail_footer.php

<p>---</p>
<p>Saygılarmızla,</p>
<p><?php echo COMPANY; ?></p>
<p><a href="<?php echo HOST; ?>"><?php echo HOST; ?></a> - <a href="<?php echo RETAIL; ?>"><?php echo RETAIL; ?></a></p>
<p><?php echo _('Tel').' : '?><a href="tel:<?php echo PHONE; ?>"><?php echo PHONE; ?></a> - <a href="tel:<?php echo PHONE2; ?>"><?php echo PHONE2; ?></a></p>
<p><?php echo _('Adres') . " : " . ADDRESS; ?></p>
<p><a href="<?php echo FACEBOOK; ?>"><?php echo FACEBOOK; ?></a></p>
<p><a href="<?php echo TWITTER; ?>"><?php echo TWITTER; ?></a></p>
[[tracking_beacon]]

And i want to include it inside $message

Here is an example of my $message body

$message = '<html lang="tr">
    <head>
        <meta charset="UTF-8" />
        <style type="text/css">
            body {color: #333; }
            .red {color: #B20F24; font-weight: bold;}
        </style>
            <title>Şifre Sıfırlama</title>
    </head>
    <body>
        <p><strong>Sayın, '.$name.'</strong></p>


        <p>Tarafımıza <strong>'.$dateObj->getLocalTime($date).'</strong> tarihinde <strong>'.$ip.'</strong> IP adresi üzerinden şifre sıfırlama talebi gelmiştir.</p>

        <p>Böyle bir talebiniz olmadıysa bu e-postayı dikkate almayınız.</p>
        <p>Eğer parolanızı unuttuysanız, lütfen aşağıdaki linke tıklayarak şifre sıfırlama sürecine gidiniz.</p>
        <p><a href="'.$url.'">'.$url.'</a></p>

        <!-- I HAVE TO ADD MAIL FOOTER HERE --> 
    </body>
</html>';

It is ridiculous but i don't know the solution.

include function for including scripts. I cannot use for this problem.

Cihan Küsmez
  • 1,967
  • 5
  • 22
  • 41

3 Answers3

0

I don't have experience with it, but maybe you can try to add a div with CSS to force it to the bottom? You can try something like this:

<div style="position:absolute; bottom:0;">Footer</div>
S.Pols
  • 3,414
  • 2
  • 21
  • 42
0

<?php Echo '<p>---</p>'; Echo '<b>'.$name.'</B>'; ...... ?>

Change the content of footer.php to all in php tag instead of mixing html and php .then simply includs the footer.

0

I solved the problem different way.

i create mail_config.php and i added my configuration details inside this script. And i created a mail_footer() function. And i added inside the body.

Cihan Küsmez
  • 1,967
  • 5
  • 22
  • 41