Jump to content

Creating new rows in email


monkeybidz

Recommended Posts

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

[b]$invoice_num[/b] & [b]$description[/b]

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.
Link to comment
https://forums.phpfreaks.com/topic/9199-creating-new-rows-in-email/
Share on other sites

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".'>');
?>
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:
[code]

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

[/code]

then you could replace
[code]
Invoice Number Description
---------------------------------------------------------------
$invoice_num - $description
[/code]

with $email_discription.

see if you can figure that out.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.