close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Including recordset in body of email message

Thread began 10/05/2011 12:03 pm by sandy170299 | Last modified 10/06/2011 11:05 am by Jason Byrnes | 1239 views | 12 replies |

sandy170299

Including recordset in body of email message

I have a page which is filtered by a recordset based on a URL parameter of a field called ID. The recordset is filtering correctly and I have set up universal email. However, it's not connecting to the recordset and I'm not sure how to go about that? The email is being sent with nothing in the body. Is there some documentation you can point me to? Thanks!

Sign in to reply to this post

sandy170299

p.s. The trigger is set to Recordset: getEmail is not empty

Sign in to reply to this post

Jason ByrnesWebAssist

see the following post for details:
showthread.php?t=17869

Sign in to reply to this post

sandy170299

Jason, I added this to the top of my page, per the article

<?php
global $RecipArray;
global $RecipIndex;
?>

and added this code in the body of my email, replacing the field name with the appropriate field names.

<?php echo($RecipArray[$RecipIndex][0]["[yourColumnName]"]); ?>

It's still sending a blank email.

Sign in to reply to this post

Jason ByrnesWebAssist

you need to replace:
"[yourColumnName]"

with the name of your columns from the recordset. for example, if one of the recordset columns is named "firstName"


the code should be:

<?php echo($RecipArray[$RecipIndex][0]["firstName"]); ?>

Sign in to reply to this post

sandy170299

That's exactly what I did.

<?php echo($RecipArray[$RecipIndex][0]["fname"]); ?> <?php echo($RecipArray[$RecipIndex][0]["lname"]); ?>

etc.

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of your pages please.

Sign in to reply to this post

sandy170299

I think this is all you need. Please see attached.

Attached Files
WA_Errors.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you have the recordset code inside of a loop that goes through the FORM post, but you do not have a form for this email.

change this code:

php:
<?php

foreach( $_POST as $pkey => $pval ){
  if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes))  {
?>
                    <tr valign="top">
                        <th style="font-size: 12px; width: 134px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
                        <td style="font-size: 12px; padding: 3px;">
                        <?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?>

<?php echo($RecipArray[$RecipIndex][0]["[fname]"]); ?> <?php echo($RecipArray[$RecipIndex][0]["[lname]"]); ?>                        
                        </td>
                    </tr>
<?php
  
}
}
?>





to:

php:
<tr valign="top">

                        <th style="font-size: 12px; width: 134px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
                        <td style="font-size: 12px; padding: 3px;">
                        <?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?>

<?php echo($RecipArray[$RecipIndex][0]["[fname]"]); ?> <?php echo($RecipArray[$RecipIndex][0]["[lname]"]); ?>                        
                        </td>
                    </tr>
Sign in to reply to this post

sandy170299

Sorry, still not working. This is what the email looks like now:

Information Submitted: 10-5-2011 | 3:44 PM MST
: Signer's Name: s s
s
s
s, s s
s
s

I have no idea where the s is coming from. It's not in any field values.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...