virtualadz Posted May 5, 2006 Share Posted May 5, 2006 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 voidis there a way someone can tell me how do i customize this email. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 5, 2006 Share Posted May 5, 2006 "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 More sharing options...
virtualadz Posted May 5, 2006 Author Share Posted May 5, 2006 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 More sharing options...
justsomeguy Posted May 5, 2006 Share Posted May 5, 2006 Yes, replace the <br> with \n Link to comment Share on other sites More sharing options...
virtualadz Posted May 5, 2006 Author Share Posted May 5, 2006 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 More sharing options...
justsomeguy Posted May 5, 2006 Share Posted May 5, 2006 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 More sharing options...
virtualadz Posted May 5, 2006 Author Share Posted May 5, 2006 ok now probs i will settle with line break only, please stay online as i test Link to comment Share on other sites More sharing options...
virtualadz Posted May 6, 2006 Author Share Posted May 6, 2006 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 More sharing options...
justsomeguy Posted May 6, 2006 Share Posted May 6, 2006 What do you mean it didn't work, what did it do? What does the email look like? You also can't use the <ul>, this is a plain text email, not html. Link to comment Share on other sites More sharing options...
virtualadz Posted May 6, 2006 Author Share Posted May 6, 2006 (edited) i am sorry it \n did work, there is one more thing what does this mean \r Edited May 6, 2006 by virtualadz Link to comment Share on other sites More sharing options...
Little Goat Posted May 6, 2006 Share Posted May 6, 2006 \r means line return. if you want your text to work in both plain text and formattted text you would add that to make this: \r\n or line return, newline.LG Link to comment Share on other sites More sharing options...
justsomeguy Posted May 8, 2006 Share Posted May 8, 2006 \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 More sharing options...
virtualadz Posted June 18, 2006 Author Share Posted June 18, 2006 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now