close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Add the list of recipients into the body of the email

Thread began 9/08/2015 12:21 pm by Sweens | Last modified 9/17/2015 1:12 pm by Ray Borduin | 2915 views | 31 replies |

Sweens

Add the list of recipients into the body of the email

Hi

I have a page which sends to multiple recipients from checkboxes - works very well and has done for years!

However, a common complaint from users is that they don't know who else has been sent the email; they don't want to see the list of email addresses (which would be bad practice anyway), but would like to see a list of names below the content of the message, e.g.

This message was also sent to Fred Bloggs, Joe Smith, Ann Dover
----------------------

The checkbox has the following code:

<input type="checkbox" name="toEmail[]" value="<?php echo $row_rsMembersEmail['MemEmail']; ?>" id="toEmail_<?php echo $row_rsMembersEmail['RotID']; ?>" />

The member's name is displayed next to the select box, but isn't used other than that.

Is this possible?

Many thanks
Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

Add a recordset to the email body page with a repeated region to display the names filtered the same way as the recordset that is used to send the emails.

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

Sweens

Gosh - that was quick!! I was still updating the question!

Not sure I understand fully; should it be filtered by something like WHERE MemEmail = $_POST['MemEmail']

Thanks
Chris

Sign in to reply to this post

Ray BorduinWebAssist

It would probably be more like: "WHERE MemEmail IN (" . implode(",",$_POST['MemEmail']) . ")"

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

Sweens

Hi Ray

Hmmn - not knowledgeable enough to get the correct code for the repeat region; I've had a guess and no errors are shown in the page, but no emails are sent!

Many thanks

Chris

Sign in to reply to this post

Ray BorduinWebAssist

IT seems like it would work. Maybe the recordset isn't being built properly...

Try adding this to the email body:
$MailBody = $MailBody . $query_rsMemRecips;

That will display the SELECT statement you are using to create the recordset and maybe you can spot the problem that way.

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

Sweens

Hi Ray

No difference. however, I've added error reporting to the waue page and get the following error

Warning: require_once(../../Connections/connRoSite.php): failed to open stream: No such file or directory in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 2 Fatal error: require_once(): Failed opening required '../../Connections/connRoSite.php' (include_path='.:/usr/share/pear55:/usr/share/php') in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 2

which is odd, as the connection file definitely exists at that location!
-----------------
I've added an extra ../ and now the error is

Notice: Undefined index: MemEmail in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 40 Warning: implode(): Invalid arguments passed in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 40 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND members.SiteID = 201 ORDER BY members.Surname' at line 1

which looks like it's the actual query that wrong

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

Yeah... the path is relative to the original page where the include is.

You can probably move the recordset to the page with the email server applied instead of having it on this page to resolve this problem.

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

Sweens

Thanks Ray

I've altered the query, but it's still wrong:

mysql_select_db($database_connRoSite, $connRoSite);
$query_rsMemRecips = "SELECT CONCAT(members.FirstName, ' ', members.Surname)AS RecipName FROM members WHERE members.MemEmail IN (" . implode(",",$_POST['MemEmail']) . ") ";
$rsMemRecips = mysql_query($query_rsMemRecips, $connRoSite) or die(mysql_error());
$row_rsMemRecips = mysql_fetch_assoc($rsMemRecips);
$totalRows_rsMemRecips = mysql_num_rows($rsMemRecips);

I now get this error message:

Notice: Undefined index: MemEmail in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 36 Warning: implode(): Invalid arguments passed in /home/sites/rotary-site.org/public_html/webassist/email/waue_membership_3.php on line 36 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

Use:

$query_rsMemRecips = "SELECT CONCAT(members.FirstName, ' ', members.Surname)AS RecipName FROM members WHERE members.MemEmail IN (" . (isset($_POST['MemEmail'])?implode(",",$_POST['MemEmail']):"-1") . ") ";

Sign in to reply to this post
Did this help? Tips are appreciated...
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...