Jump to content

Archived

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

monkeybidz

Creating new rows in email

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.

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
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".'>');
?>

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.