Jump to content

customize php email how to


virtualadz
 Share

Recommended Posts

hey everyone i want to customize php email (not much just make text bold and add line breaks) . i added <b> and <br> but the file simply ignored it: look in this code for <b><br><ul><li> and such tags. when i make this file, the output which come is shown below. start looking in the code from Cheque must be ....Input

<?php  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Make Payable To:". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nSend To:\n" . STORE_NAME_ADDRESS . "\n\n" . 'Cheque must be payable at Silchar, Assam.<br><br><b>Deposit Cheque:</b><br>Bank: UTI Bank<br>A/c. No.: 271010200001137<br><br>Your order will not ship until we receive the payment.<br><br>Email us the following details after making the payment<ul><li>Bank Name<li>Cheque Number<li>Amount<li>Date Issued</ul>Please make the payment within 7 days of order or else your order will be declared void');?>

Output

Cheque must be payable at Silchar, Assam.Deposit Cheque:Bank: UTI BankA/c. No.: 271010200001137Your order will not ship until we receive the payment.Email us the following details after making the paymentBank NameCheque NumberAmountDate IssuedPlease make the payment within 7 days of order or else your order will be declared void
is there a way someone can tell me how do i customize this email.
Link to comment
Share on other sites

"MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER"That's a ###### of a constant name.That's a plain text email, not html email. Line breaks are "\n". You can't add text formatting in plain text. Unless you have a good reason to use html, it's probably better to stay with plain text, it's more universal.edit: I can't say '######'?

Link to comment
Share on other sites

but hey how i give line breaks, it looke ugly without them, i hope you saw the output of it as well. line breaks can be added in this same email file there are codes which . "/n" . and there itself comes the line break, is there a way i can too do it. this is the full code of that file

<?php/*  $Id: moneyorder.php,v 1.6 2003/01/24 21:36:04 thomasamoulton Exp $  osCommerce, Open Source E-Commerce Solutions  http://www.oscommerce.com  Copyright (c) 2002 osCommerce  Released under the GNU General Public License*/  define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Cheque/Direct Deposit');  define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', '<b>Make Payable To</b>: ' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br><b>Send Cheque To:</b><br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Cheque must be payable at Silchar, Assam.<br><br><b>Deposit Cheque:</b><br>Bank: UTI Bank<br>A/c. No.: 271010200001137<br><br>Your order will not ship until we receive the payment.');  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Make Payable To:". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nSend To:\n" . STORE_NAME_ADDRESS . "\n\n" . 'Cheque must be payable at Silchar, Assam.<br><br><b>Deposit Cheque:</b><br>Bank: UTI Bank<br>A/c. No.: 271010200001137<br><br>Your order will not ship until we receive the. payment.<br><br>Email us the following details after making the payment<ul><li>Bank Name<li>Cheque Number<li>Amount<li>Date Issued</ul>Please make sure your payment is with us within 7 daysor your order will be cancelled.');?>

Link to comment
Share on other sites

will only \n work. should i include it this way without a space before it. or should i give a space before and after it:Deposit Cheque:\nBank: UTI Bank\nA/c. No.: 271010200001137\n\nYour order will not one more thing \n sometimes is not included as it is used for giving apostrophewhat\salso can i make the text bold

Link to comment
Share on other sites

The escape character (/) provides a lot of characters: \n - newline\t - tab\' - single quote\" - double quote\\ - slashYou don't need space around them. And no, you cannot change text formatting in plain text emails.

Link to comment
Share on other sites

hi, i tried every thing giving \n wihtout space, with space within quotation, twice \n\n but nothing worked just see the code below, and tell what to do<?php/* $Id: moneyorder.php,v 1.6 2003/01/24 21:36:04 thomasamoulton Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License*/ define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Cheque/Direct Deposit'); define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', '<b>Make Payable To</b>: ' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br><b>Send Cheque To:</b><br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Cheque must be payable at Silchar, Assam.<br><br><b>Deposit Cheque:</b><br>Bank: UTI Bank<br>A/c. No.: 271010200001137<br><br>Your order will not ship until we receive the payment.'); define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Make Payable To:". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nSend To:\n" . STORE_NAME_ADDRESS . "\n\n" . 'Cheque must be payable at Silchar, Assam.\n\n<b>Deposit Cheque:</b>\nBank: UTI Bank\nA/c. No.: 271010200001137\n\nYour order will not ship until we receive the. payment.\n\nEmail us the following details after making the payment<ul><li>Bank Name<li>Cheque Number<li>Amount<li>Date Issued</ul>Please make sure your payment is with us within 7 daysor your order will be cancelled.');?>

Link to comment
Share on other sites

\r is actually a carriage return, and \n is a line break. I believe Unix and those guys use \r\n for text files. The email headers need to be separated with \r\n, but in the body of the email I believe you only need to use \n.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...