close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Issue with Name field in batch emails

Thread began 2/22/2013 3:14 am by iainmacdonald331081 | Last modified 2/22/2013 10:47 am by Jason Byrnes | 1031 views | 3 replies |


Issue with Name field in batch emails

An odd one has cropped up today - its a site that has been in use for a good few years now, where the site owner can search for suitable candidates for a job, and send them all emails to let them know of vacancies using UE.

As far as anyone knew, it has all been working great.

The emails are set to loop through the recordset, and send all the emails - which works fine.

The emails start:

Hi <FirstName>,

And the issue is that the emails are using the FirstName of the first record in the recordset.

So if its going to:

Billy Bob
Jo Jenkins
Fiona Flinders

They all get an email starting:

Hi Billy,

And yet the loop is obviously working, as they do all get sent an email.

Where is the first place I should be looking to check this out?

I've looked at the page where the emails are generated, and looked in the UE > Create Email Message behaviour.

Clicked on the advanced "to" field in there which looks correct:

Type - Recordset Loop
Value - rsEmailCandidates.Email

Recordset loop checked - rsEmailCandidates and Email.

Which all seems fine, and seems to be working given that everyone gets an email.

But for some reason its using the first FirstName in all the emails.

The bit of HTML form the UE page containing the email looks OK:

<!-- InstanceBeginEditable name="emailbody" -->
Hi <?php echo $row_rsEmailCandidates['FirstName']?>,
<p><?php echo $row_rsEmailMessage['message']?></p>
<p>Kind regards,<br>
<?php echo $row_rsEmailMessage['signature2']?></p><!-- InstanceEndEditable -->
<!-- InstanceEnd -->

Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

at the top of the email tempalte, add the following code:

global $RecipArray;
global $RecipIndex;
and in the body of the email, change the recordset reference:


for example, instead of using:
Hi <?php echo $row_rsEmailCandidates['FirstName']?>,

Hi <?php echo $RecipArray[$RecipIndex][0]['FirstName']?>,

Sign in to reply to this post


Thanks Jason - that has fixed that up.

Would that have been something I missed or did wrong when I set it up, or would it always have needed that manual edit?

Either way, its weird that its been used for a few years now, with no-one mentioning it, and then two people mention it in the same day this week!

Sign in to reply to this post

Jason ByrnesWebAssist

the manual edit has always been needed, see this post:

Sign in to reply to this post

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





Ease of use


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