close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Binding dynamic data into email

Thread began 6/24/2010 8:13 am by christina.elissa4324782 | Last modified 1/21/2011 12:44 pm by Jason Byrnes | 4663 views | 18 replies |

christina.elissa4324782

Binding dynamic data into email

I am creating a registration form that is being inputted into a database. Two of the fields are being created from record sets and being inputted into other relational tables in the database using the manage relational tables function. I also want the form to be emailed to the person filling out the form. The results in the email that I am getting are:

WADA RepeatID sessionId 0: 1
WADA RepeatID sessionId 1: 2
sessions 1: 2
WADA RepeatID sessionId 2: 3
sessions 2: 3
WADA RepeatID sessionId 3: 4
sessions 3: 4
WADA RepeatID sessionId 4: 5
sessions 4: 5
WADA RepeatID sessionId 5: 6
sessions 5: 6
WADA RepeatID sessionId 6: 7

and

WADA RepeatID groupId 0: 1
WADA RepeatID groupId 1: 2
WADA RepeatID groupId 2: 3
WADA RepeatID groupId 3: 4
WADA RepeatID groupId 4: 5
registeredGroup 4: 5
WADA RepeatID groupId 5: 6
WADA RepeatID groupId 6: 7
WADA RepeatID groupId 7: 8
WADA RepeatID groupId 8: 9
Insert: Insert
WADAInsertRecordID:

How can I get them to list as an array using the names rather than the id number (Sessions: Session 1, Session 2, etc.)? The numbers are needed of course for the input into the relational tables; Is it possible to do a record set to get the information I need and bind it?

Thank you in advance.

Also, how can I have it not include the Insert button or the Insert Record ID?

Thank you in advance.
Christina

Sign in to reply to this post

Jimmy Wu

Are you using one of the default mail templates? If you are, all the posted values will be input into the email. If you want to customize the email yourself, you will have to uncheck the generate email with template and click to edit the email. Then you will be able to bind the different values you want onto the email and also bind recordset values to the email, so you can use the name instead of the id.

Sign in to reply to this post

christina.elissa4324782

I am editing the template for the email. I grabbed the mysql select statement from the results page (created with data assist and manipulated for my needs):

<?php
$ParamattendeeId_WADAattendee = "-1";
if (isset($_GET['attendeeId'])) {
$ParamattendeeId_WADAattendee = (get_magic_quotes_gpc()) ? $_GET['attendeeId'] : addslashes($_GET['attendeeId']);
}
$ParamSessionattendeeId_WADAattendee = "-1";
if (isset($_SESSION['WADA_Insert_attendee'])) {
$ParamSessionattendeeId_WADAattendee = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_attendee'] : addslashes($_SESSION['WADA_Insert_attendee']);
}
$ParamattendeeId2_WADAattendee = "-1";
if (isset($_GET['attendeeId'])) {
$ParamattendeeId2_WADAattendee = (get_magic_quotes_gpc()) ? $_GET['attendeeId'] : addslashes($_GET['attendeeId']);
}
mysql_select_db($database_ifpaDataBase, $ifpaDataBase);
$query_WADAattendee = sprintf("SELECT attendee.attendeeId, CONCAT_WS(' ',salutation, firstName, middleInitial, lastName) AS name , rankService, positionTitle, company, street, street2, city, stateCountry, postalCode, phoneNumber, faxNumber, email, payBy, paid, GROUP_CONCAT(sessionName SEPARATOR '; ') AS sessions FROM attendee LEFT JOIN attendeeSessions ON attendeeSessions.attendeeId = attendee.attendeeId LEFT JOIN sessions ON sessions.sessionId = attendeeSessions.sessionId WHERE attendee.attendeeId = %s OR ( -1= %s AND attendee.attendeeId= %s) GROUP BY attendee.attendeeId", GetSQLValueString($ParamattendeeId_WADAattendee, "int"),GetSQLValueString($ParamattendeeId2_WADAattendee, "int"),GetSQLValueString($ParamSessionattendeeId_WADAattendee, "int"), GetSQLValueString($ParamattendeeId_WADAattendee, "int"),GetSQLValueString($ParamattendeeId2_WADAattendee, "int"),GetSQLValueString($ParamSessionattendeeId_WADAattendee, "int"));
$WADAattendee = mysql_query($query_WADAattendee, $ifpaDataBase) or die(mysql_error());
$row_WADAattendee = mysql_fetch_assoc($WADAattendee);
$totalRows_WADAattendee = mysql_num_rows($WADAattendee);
?>

I did have some errors in the sql, but I fixed them and am still not getting an email

have I done something incorrectly with using this code? I'm connecting to the database fine, the information is being inserted into the database correctly. It's just not emailing.

Sign in to reply to this post

Jimmy Wu

Where did you add this code to? Is it on the email template itself or is it on your form page?

If you could zip up and attach the email template so I can take a look at it, that would be great.

Sign in to reply to this post

christina.elissa4324782

Here is the template file. Thank you for your help.

Attached Files
ifpaConferenceRegistration.php.zip
Sign in to reply to this post

Jimmy Wu

I don't see any issues with the email template, so it might have something to do with the query not returning any results. Have you tested the query directly in your database?

Sign in to reply to this post

christina.elissa4324782

because the query is based off a session, it's difficult.
I have replaced:
WHERE attendee.attendeeId = %s OR ( -1= %s AND attendee.attendeeId= %s) with WHERE attendee.attendeeId = 1

or some other id # and I get results on the web page.

Could there be something wrong with the way I'm calling the session? I have included the registration page as well in case there is something there.

Attached Files
attendee_Signup.php.zip
Sign in to reply to this post

Jimmy Wu

It looks like the session variable is being set up correctly to me. Its possible that the session is getting cleared somehow when it is going to the email page.

Sign in to reply to this post

christina.elissa4324782

In the waue_attendee_Signup_1.php page (created when doing the universal email) there is a session named "waue_attendee_Signup_1_Status" referenced twice. My session that is grabbing the data in the template page is "WADA_Insert_attendee". Should one of these be changed? What can I do to get the session in the email template if it is being cleared?

Sign in to reply to this post

Eric Mittman

Are you using these different session variables to hold the same value? Only if you are holdig the same value in these session variables should you update the entries for them all to be the same.

What is the current result that you are are getting? Is your recordset returning the rows that you need, what are you getting in the email message now with this?

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...