Hello everyone,
I have read and read and read but can’t find anything to shed some light on my problem. What I am trying to do is create an eForm that would email the owner of a "custom" branded site based on their email address in the system. This has to be dynamic because currently we have about 80 custom websites in this system. Below is the entire snippet that I have. You will notice the email address comes from a database and I have assigned the variable $resEmail[’email’] as the email address. Is it possible to "inject" this variable into a snippet call instead of plain text? I have tried
&to=`.$resEmail[’email’].`,
&to=`$resEmail[’email’]`,
&to=$resEmail[’email’], and nothing seems to work! Is it even possible to place variables into a snippet call before it is processed? Any help is GREATLY appreciated!
<?php
$blaid = $modx->documentObject;
$parent = $modx->getParent($blaid[’id’]);
$username = $parent[’alias’];
$table = $modx->getFullTableName("web_users");
$sqlEmail = $modx->db->select("id", $table, "username = ’$username’");
$resEmail = $modx->db->getRow($sqlEmail);
$table = $modx->getFullTableName("web_user_attributes");
$sqlEmail = $modx->db->select("email", $table, "id = ’$resEmail[id]’");
$resEmail = $modx->db->getRow($sqlEmail);
if(empty($resEmail[’email’])){
$resEmail[’email’] = "
[email protected]";
}
switch($_POST[’insuranceType’]){
case "auto":
?>
[!eForm? &formid=`autoQuoteForm` &tpl=`autoQuoteForm` &report=`autoQuoteFormEmail` &to=`.$resEmail[’email’].` &subject=`Auto Quote Received` &from=`
[email protected]` &thankyou=`46`!]
<?
break;
case "property":
?>
[!eForm? &formid=`propQuoteForm` &tpl=`propQuoteForm` &report=`propQuoteFormEmail` &to=`.$resEmail[’email’].` &subject=`Property Quote Received` &from=`
[email protected]` &thankyou=`46`!]
<?
break;
case "specialty":
?>
[!eForm? &formid=`specialtyQuoteForm` &tpl=`specialtyQuoteForm` &report=`specialtyQuoteFormEmail` &to=`.$resEmail[’email’].` &subject=`Specialty Quote Received` &from=`
[email protected]` &thankyou=`46`!]
<?
break;
case "business":
?>
[!eForm? &formid=`businessQuoteForm` &tpl=`businessQuoteForm` &report=`businessQuoteFormEmail` &to=`.$resEmail[’email’].` &subject=`Business Quote Received` &from=`
[email protected]` &thankyou=`46`!]
<?
break;
}
?>