close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sending email to a multiple select list from a filtered recordset

Thread began 9/08/2020 8:00 am by MagsW | Last modified 9/08/2020 11:41 am by Ray Borduin | 26 views | 11 replies |

MagsW

Sending email to a multiple select list from a filtered recordset

Hi Ray, I've got a form which originally sent emails to a whole recordset, however the client has asked for this to be changed to a select list so that they can select specific people to email instead. I found another post which recommended using the DA Search behavior to filter the recordset, however I suspect I've got something in the wrong order or haven't connected something up properly as it's still emailing all the addresses in the recordset even I only select a couple. Would you mind taking a look for me? Copy of page attached.

Sign in to reply to this post

Ray BorduinWebAssist

Yes, you have the search code below the recordset code. Move lines 57-63 above the recordset that begins on line 51.

Sign in to reply to this post
Did this help? Tips are appreciated...

MagsW

I tried that but it doesn't send the email and after submission the email addresses no longer show up in the select list so it looks like it's filtering out the whole recordset (which I presume is why it also doesn't send the email!)

Sign in to reply to this post

Ray BorduinWebAssist

This post has been deleted.


Did this help? Tips are appreciated...

Ray BorduinWebAssist

The issue is with the select list... you have:

php:
<option value="$rsUsersEmail->getColumnVal("user_email")">


it should be:

php:
<option value="<?php echo($rsUsersEmail->getColumnVal("user_email")); ?>">
Sign in to reply to this post
Did this help? Tips are appreciated...

MagsW

We're getting somewhere, it's now sending to the first selected email but not any others. Following submission it filters the list to only show the first email address in the recordset. I've added FTP details in the PM and attached an updated page.

Sign in to reply to this post

Ray BorduinWebAssist

Change your select name from:
<select name="users"

to:
<select name="users[]"

You need to name it with brackets to support multiple selections with PHP.

Sign in to reply to this post
Did this help? Tips are appreciated...

MagsW

That's working now! Just one other thing, I need to clear that filter after the email has been sent as the list then only displays the emails that have been chosen. I added the following above the Search PHP block:

<?php
@session_start();
if ((isset($_GET['reset']) && $_GET['reset'] != "")){
// WA_ClearSession
$clearAll = FALSE;
$clearThese = explode(",","searchrsUsersEmail_WADbSearch1");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>

Then set the email form redirect as follows:

$Email->Redirect = "firm-overview2?sent=true&reset=true";

It redirects and sends the emails but doesn't clear the search filters.

Sign in to reply to this post

Ray BorduinWebAssist

Use:
$searchrsUsersEmail_WADbSearch1->clearSearch();

Sign in to reply to this post
Did this help? Tips are appreciated...

MagsW

I may have put that in the wrong place - is this what you meant?

<?php
@session_start();
if ((isset($_GET['reset']) && $_GET['reset'] != "")){
// WA_ClearSession
$clearAll = FALSE;
$clearThese = explode(",","$searchrsUsersEmail_WADbSearch1->clearSearch()");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...