Export to Email, using a drop down list for Send To

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
amciotola
User
Posts: 10

Export to Email, using a drop down list for Send To

Post by amciotola »

I would like to use a drop down list with the export to email function for the Send To field. I honestly don't know where to start other than knowing I need to use a select statement and editing the ewemail11.php file. I have succeeded only in getting a drop down field with no content and the rest of the send email disappearing.

I tried using code from one of the add pages, which is how I get what I described above.

I think this is the select statement I would need it's just getting the rest into this
$sSqlWrk = "SELECT email FROM emaillist

As stated other times, I'm a complete novice and I have scoured this forum for what I am looking for with no luck.

Thank you
A


amciotola
User
Posts: 10

Post by amciotola »

<div class="form-group">
<label class="col-sm-2 control-label ewLabel" for="sender"><?php echo $Language->Phrase("EmailFormSender") ?></label>
<div class="col-sm-10"><input type="text" class="form-control ewControl" name="<?php echo EW_SENDER_EMAIL ?>" value="<?php echo EW_SENDER_EMAIL ?>"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ewLabel" for="recipient"><?php echo $Language->Phrase("EmailFormRecipient") ?></label>
<div class="col-sm-10"><input type="select" class="form-control ewControl" name="SELECT email FROM emaillist" id="SELECT email FROM emaillist"></div>
</div>


mobhar
User
Posts: 11737

Post by mobhar »

Just customize the "recipient" section to the following code:

<div class="form-group">
	<label class="col-sm-2 control-label ewLabel" for="recipient">Recipient <?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
	<div class="col-sm-10">

<?php
$sSql = "SELECT email FROM emaillist";
$rs = ew_Execute($sSql);
$cntRec = $rs->RecordCount();
echo '<select id="recipient" name="recipient" class="form-control ewControl">';
echo '<option value="" selected="selected">'.$Language->Phrase("PleaseSelect").'</option>';
if ($cntRec > 0) {
$rs->MoveFirst();
while (!$rs->EOF) {
echo "<option value='".$rs->fields("email")."' >".$rs->fields("email")."</option>";
$rs->MoveNext();
}
$rs->Close();
}
echo "</select>";
?>
</div>
</div>


amciotola
User
Posts: 10

Post by amciotola »

Works perfectly.

Thank you mobhar!

A


Post Reply