Hello!
So I'm working on a snippet that does something very simply (and hopefully elegantly): A selectable-recipient email form where the recipients are defined and edited in a CMP, all while protecting the e-mail address from being exposed to the internet in the html code.
I'm trying to develop something useful - so the structure is based on the infamous 'doodles' tutorial. I've successfully modified the schema etc. and it's working beautifully, but in implementing the functional end of things I need help understanding how to query my extra's table using the xpdo model that I have setup.
The Gist:
The user selects the recipient.
<select id="selectRecipient">
<option value="21">Tom (Director)</option>
<option value="22">Dick (Maintenance)</option>
<option value="23">Harry (Barber)</option>
</select>
The Snippet catches the form data, and I need to turn the value (the row id) into an e-mail address:
Table Rows consist of 4 fields: id, name, title, email
$recipent = //Mysterious xPDO Query that returns email address from the row id
...
$modx->mail->address('to','$recipient');
...
I know this is *really* simple stuff, but I appreciate any help. (And I'll promise to share when I get it working.)
[ed. note: anablepo last edited this post 13 years, 10 months ago.]