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

Include user ID in email log

Thread began 12/21/2010 10:14 pm by webmaster118088 | Last modified 10/20/2014 5:31 pm by Jason Byrnes | 10886 views | 32 replies |

webmaster118088

Include user ID in email log

Good evening, I would like included in the email log the id of the user who sent you the e-mail, I tried the recordset from which collects multiple addresses to send them but just insert the id of the first record in all log records.

I would also like to know how to implement the user name in the message body as in previous versions was as simple as placing the body in the recordset user name field.

The data for sending the collected from a mysql user table for mailing.

Sign in to reply to this post

Ray BorduinWebAssist

Add this to the top of the email body template page:

<?php
global $RecipArray;
global $RecipIndex;
?>



and in the body and for the email log settings use:

<?php echo($RecipArray[$RecipIndex][0]["[yourColumnName]"]); ?>



and you can add any references to the recordset columns used as the To loop.

Sign in to reply to this post

webmaster118088

Solucionado

Solucionado,

En el archivo de la recogida de datos he añadido esto:

$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex][] = $row_rsusersmail;
$RecipArray[$CurIndex][] = $rsusersmail;
$RecipArray[$CurIndex][] = "UserEmail";
$TotalEmails += mysql_num_rows($rsusersmail);
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex][] = $row_rsusersmail;
$RecipArray[$CurIndex][] = $rsusersmail;
$RecipArray[$CurIndex][] = "UserID";
$TotalEmails += mysql_num_rows($rsusersmail);


Y en el de envío esto:

//Success Or Failure
$MailLogBindings->SuccessOrFailure->ToDo = "insert";
$MailLogBindings->SuccessOrFailure->Connection = "conexionmysql";
$MailLogBindings->SuccessOrFailure->TableName = "email_log";
$MailLogBindings->SuccessOrFailure->EmailColumn = "EmailTo";
$MailLogBindings->SuccessOrFailure->ColumnList = array("NumeroDeMailing", "EmailLogUserId", "EmailTo", "EmailFrom", "EmailSubject", "EmailBody", "EmailHeader", "EmailError", "EmailStatus");
$MailLogBindings->SuccessOrFailure->TypeList = array("',none,''", "',none,''", "',none,''", "',none,''", "',none,''", "',none,''", "',none,''", "',none,''", "',none,''");
$MailLogBindings->SuccessOrFailure->ValueList = array("".$row_rsmailuser['id_mailing'] ."", "".$RecipArray[$RecipIndex][0]['UserID']."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_To"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_From"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_Subject"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_Body"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_Header"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_Log"] ."", "".$_SESSION["waue_mailing_presentacion_miscasas_1_Status"] ."");

Sign in to reply to this post

toms016390756

Originally Said By: Ray Borduin
  Add this to the top of the email body template page:
<?php
global $RecipArray;
global $RecipIndex;
?>


and in the body and for the email log settings use:
<?php echo($RecipArray[$RecipIndex][0]["[yourColumnName]"]); ?>


and you can add any references to the recordset columns used as the To loop.  



Thanks I needed that.

Sign in to reply to this post

cjohnson335078

This works, thanks - will this be part of a future update? Wondering if there a use-case where this wouldn't make sense?

Sign in to reply to this post

Ray BorduinWebAssist

We could automatically add:

<?php
global $RecipArray;
global $RecipIndex;
?>

to the templates, but you'll still have to use the correct syntax when referencing the content on the page... we can try to figure out a better way to address that in the next update.

Sign in to reply to this post

cjohnson335078

Also, to get a EmailTo_UserID field into the email_log table - using the above syntax/approach - ie: ($RecipArray[$RecipIndex][0]["UserID"]) as the "value" for my custom added EmailTo_UserID column in the mail log settings file - the UE window reports a non-terminal error and will remove the code below on update of the UE editor behavior.

The thing is - this code/approach works (tested). Is there any way to make it stick and not crash/disrupt the editor?

Sign in to reply to this post

Ray BorduinWebAssist

I'll have to look into it further. What is the exact error you get and when exactly do you see it? I'll send this thread to someone in our QA department to try to reproduce it and log a bug.

Sign in to reply to this post

ryanteets270615

this doesn't work for me.

I have this code in my page and still the values are not being received by the email body.

Can you open a ticket for me so I can send you my files?

Sign in to reply to this post

Ray BorduinWebAssist

I have opened a support ticket that we can use to further debug this issue.

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