Jump to content


Photo

Creating new rows in email


  • Please log in to reply
3 replies to this topic

#1 monkeybidz

monkeybidz
  • Members
  • PipPipPip
  • Advanced Member
  • 330 posts

Posted 06 May 2006 - 07:40 PM

I have a variables being passed from another page to an email script:

$invoice_num & $description

In some cases, the results for this variable will require more than one row. How do i do this?

Currently sending email like this:

Example:

Invoice Number Description
-----------------------------------------------------------
123456789 item i am selling 1


I want to make a new row if more than one Invoice number is available.

Example:


Invoice Number Description
-----------------------------------------------------------
1234567809 - item i am selling 1
1234567810 - item i am selling 2
1234567811 - item i am selling 3

Thanks in advance.


#2 tjhilder

tjhilder
  • Members
  • PipPipPip
  • Advanced Member
  • 136 posts
  • LocationKent, UK

Posted 06 May 2006 - 08:14 PM

could you post the code you are using? (although if this is a big amount of code, it's recommended that you save it to a txt file on the server you host your website and then link to it.)

#3 monkeybidz

monkeybidz
  • Members
  • PipPipPip
  • Advanced Member
  • 330 posts

Posted 06 May 2006 - 08:42 PM

It sends all the info OK, but would like it if the $invoice_num & $description create a new row with sorted invoice number, and description. Currently i need to send an invoice manually each time for each invoice, but i am trying to get to where i can just manually send all invoices for that customer at once at the end of the month.
Heres the code:
<?
mail ("$email", 'Your Invoice for '."$month".'/'."$year",

"This is a summary of the amount due for $month/$year.

You have an amount due of $$total_due for the following item(s) listed
at $website_name.

Invoice Number Description
---------------------------------------------------------------
$invoice_num - $description

This amount is due by $due_date day of this month.
If payment is not receieved by the due date, your account will be suspended.

If you have any questions, please contact:
$admin_email",
'From:'."$website_name". '<'."$admin_email".'>');
?>

#4 tjhilder

tjhilder
  • Members
  • PipPipPip
  • Advanced Member
  • 136 posts
  • LocationKent, UK

Posted 07 May 2006 - 11:27 AM

since i've not done this before I'm not totally sure what to do, but an idea might be to create a loop before the mail() function to get the infomation, then create it so that it gets sent into the same varible?

kinda like this:

$email_discription = "Invoice Number Description\n
---------------------------------------------------------------\n";
$email_discription .= "invoice 1\n";
$email_discription .= "invoice 2\n";
$email_discription .= "invoice 3\n";


then you could replace
Invoice Number Description
---------------------------------------------------------------
$invoice_num - $description

with $email_discription.

see if you can figure that out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users