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:
<body>
<!-- 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 -->
</body>
<!-- InstanceEnd -->
</html>
Any ideas?