getting "To" email value from a...

User 2794810 Photo

Registered User
24 posts

Hi all,
Having used form builder to create a form I want to be able to replace the "To" email address in the notification email with the content of a variable. I assume this means finding a way to replace the "To" element in form.cfg.php with the value of the variable but I haven't a clue whether a) if it can be done or b) how to achieve this.

The php used to open the table and populate the forms host page is
// load record from 'advertisers'
list($advertisersRecords, $advertisersMetaData) = getRecords(array(
'tableName' => 'advertisers',
'where' => whereRecordNumberInUrl(0),
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
$advertisersRecord = @$advertisersRecords[0]; // get first record
if (!$advertisersRecord) { dieWith404("Record not found!"); } // show error message if no record found

The variable that I need to have replace the "To" field in form.cfg.php is
<?php echo htmlencode($advertisersRecord['email_address']) ?>

I am not a php programmer so would appreciate anyone's help in pointing me in the right direction to achieve what I am looking to do.

Thanks in advance for any help provided.

User 187934 Photo

Senior Advisor
18,468 posts

Hi Steve,
Can you get the variable when the form loads?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
Here's my CoffeeCup SCCP Shop with examples of what can be done.
This is a site I built for my work.(RSD)
This is a site I built for use in my job.(HTML Editor)
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.