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

email log addin to the db

Thread began 2/06/2021 7:08 am by Jamie | Last modified 2/10/2021 9:06 am by Ray Borduin | 117 views | 6 replies |

Jamie

email log addin to the db

Hey Ray

Couple of questions re universal email. On the atatched page (direct-access.php) why would the submit upload 2 entries into the database? Am assuming its because there are 2 $Email->addTo but how can I stop that from happening and retain the 2 emails?

2nd question is how do I combine these to inputs to both be added to one column 'Name'?

$Email->onSend->Query->bindColumn("FirstName", "s", "".((isset($_POST["First_Name"]))?$_POST["First_Name"]:""));
$Email->onSend->Query->bindColumn("LastName", "s", "".((isset($_POST["Last_Name"]))?$_POST["Last_Name"]:""));



Thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

You could copy your email server behavior so it sends to the two recipients separately and only use logging for one or the other.

You could combine the fields like:

php:
$Email->onSend->Query->bindColumn("FullName", "s", "".((isset($_POST["First_Name"]))?$_POST["First_Name"]:"") ." " . ((isset($_POST["Last_Name"]))?$_POST["Last_Name"]:""));

    $Email->onSend->Query->bindColumn("LastName", "s", "".);
Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

Many thanks Ray

How would I create a cron and script to remove any records in the email_log table that are older than 90 days?

Sign in to reply to this post

Ray BorduinWebAssist

Create a web page that does it, then add a cron to run that web page daily.

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

Jamie

So should this remove any record in table email_log where EmailDate is older than 90 days?

<?php require_once('../Connections/DBConnection.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
$LogPurge = new WA_MySQLi_RS("LogPurge",$DBConnection,0);
$LogPurge->setQuery("DELETE FROM email_log WHERE EmailDate < DATEADD(day, -90, GETDATE())");
$LogPurge->execute();
?>
Sign in to reply to this post

Ray BorduinWebAssist

Yes, that looks like it would do the trick.

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

Jamie

thanks Ray

Sign in to reply to this post

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...