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
20,181 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.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2922584 Photo


Registered User
1 post

I also would like to know this answer :)
User 187934 Photo


Senior Advisor
20,181 posts

In order to help with this I need to know where the variable is coming from.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

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.