Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PHP Email - Repeat Region Equivalent in Body?

Explorer ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

My client wants a summary of products registered in the body of an email. My email script works great but I don't know how to add the summary of products (what I'm calling a 'repeat region').

Thanks in advance for your advice and feedback

TOPICS
Server side applications

Views

503
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

jasons wrote:
> My client wants a summary of products registered in the body of an email. My
> email script works great but I don't know how to add the summary of products

I don't know what you mean by a summary of products. Where is the
information going to come from? What will it contain?

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

Thanks for the reply. My recordset, which grabs the person's email address, also contains product names registered to the person. What I am hoping for is a section of the email body to looks like this:

"Registered Products:

PRODUCTA
PRODUCTB
PRODUCTC
ETC
"

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

jasons wrote:
> Thanks for the reply. My recordset, which grabs the person's email address,
> also contains product names registered to the person.

Add them to the body of the message in exactly the same way as you
created the rest of it:

$message .="Password: $password \n\n";
$message .="Registered products:\n\n";
$message .=$row_rs_password['ProductA']."\n";
$message .=$row_rs_password['ProductB']."\n";

Or are you storing the products in a different way? For anyone to give
you help, you need to be more precise in describing your setup.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

Hi David,

Thanks for the help and my apologies for not being precise.

My recordset looks something like:

cust_id product_name order_date
100 PRODUCTA 12/23/08
100 PRODUCTB 11/23/07
100 PRODUCTC 09/22/07

So a customer could have 1 or 100 products registered so you can see why I would like to create the equivalent of a repeating region in the body of the message.

Is this more helpful to you?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 03, 2008 Jan 03, 2008

Copy link to clipboard

Copied

jasons wrote:
> My recordset looks something like:
>
> cust_id product_name order_date
> 100 PRODUCTA 12/23/08
> 100 PRODUCTB 11/23/07
> 100 PRODUCTC 09/22/07

It's not clear whether this is the same recordset as the one that
retrieves the password details, but the principle of doing this is
exactly the same as a repeat region. If you study the code of a repeat
region in a Dreamweaver page you'll see that it looks something like this:

do {
// code to be repeated
} while ($row_recordsetName = mysql_fetch_assoc($recordsetName));

So, in the code that builds the body of the email message:

$message .="Password: $password \n\n";
$message .="Registered products:\n\n";
do {
$message .= $row_recordsetName['product_name']."\n";
} while ($row_recordsetName = mysql_fetch_assoc($recordsetName));
// rest of mail() script goes here

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 04, 2008 Jan 04, 2008

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: jasons
My client wants a summary of products registered in the body of an email. My email script works great but I don't know how to add the summary of products (what I'm calling a 'repeat region').

Thanks in advance for your advice and feedback





I suggest you build a CMS for your web . If you have 100 clients or planning to have that , there's no reason for you to repeat region in PHP mail ().

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines