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

Successful send as a trigger.

Thread began 10/19/2012 2:43 pm by neo314 | Last modified 10/22/2012 2:01 pm by Jason Byrnes | 1023 views | 10 replies |

neo314

Successful send as a trigger.

In a script, I am drawing a recordset that determines if the client has already been sent an invoice. If it has not, (recordset empty trigger), the email is sent. On a successful email send, I want to update the database record to reflect that the email invoice was sent, but an unset session variable could also mean the email just was never sent because it did not need to be sent.

I thought this was typically a trigger (any successful email send), but it is not appearing in my list of values .

What value can I read that will trigger an update transaction if an email is successfully sent, but not if there is an error OR if not email is sent at all.

Sign in to reply to this post

Jason ByrnesWebAssist

in the UE code, there will be a line to set a variable named $EmailRef, for example:

php:
$EmailRef = "waue_pagename_1";




this is used as a session name further down to store the email status:

php:
$_SESSION[$EmailRef."_Status"] = $GLOBALS[$EmailRef."_Status"];




if the email is successful, that session will equal "Success", you could hand code an if statement around the update code:

php:
<?php

if(isset($_SESSION['waue_pagename_1_Status']) && $_SESSION['waue_pagename_1_Status'] == "Success") { 
<
perform update>
}
?>
Sign in to reply to this post

neo314

Perfect. Well near perfect... Should "Successful email send" be a trigger. Anyway I can use the default GUI and get a trigger that would accomplish this.

I can use this to wrap the update, but not in the GUI as a trigger, so it will work.

Sign in to reply to this post

Jason ByrnesWebAssist

no, there is not a successful email send trigger, it needs to be hand coded.

Sign in to reply to this post

neo314

OK, Thanks.

Sign in to reply to this post

neo314

Well unfortunately this trigger did not work AND I am getting no email logging.
When I dump the variables, it looks like the session values are all empty.

[waue_thank-you_1_Index] =>      
[waue_thank-you_1_Log] =>
[waue_thank-you_1_From] =>
[waue_thank-you_1_To] =>
[waue_thank-you_1_Subject] =>
[waue_thank-you_1_Body] =>
[waue_thank-you_1_Header] =>
[waue_thank-you_1_Status] =>


This site moved to GoDaddy and sends through their relay server. The emails are going through, but I have no information to log or trigger on coming back from the email server it seems.

Has this been an issue that has been addressed before? Would using PEAR make any difference?

For the time being, I had to just stop testing for the success or failure of the email and just assume it succeeds each time. (e.g. if the email code runs, assume it worked and run the update code). :confused:

Sign in to reply to this post

Jason ByrnesWebAssist

make sure you have @session_start(); on the page before referencing session variables.

it may be that you have the wrong session variable name.

use this code to dump all sessions and find the correct name:

php:
<?php @session_start(); var_dump($_SESSION); ?>
Sign in to reply to this post

neo314

The session is started. The Uemail code starts the session, and the page begins with:

<?php
/*
CONFIGURATION
*/
if (!isset($_SESSION)) {
session_start();
}...



I also do not seem to have the wrong variable name. The "code" I posted:

[waue_thank-you_1_Index] =>       
[waue_thank-you_1_Log] =>
[waue_thank-you_1_From] =>
[waue_thank-you_1_To] =>
[waue_thank-you_1_Subject] =>
[waue_thank-you_1_Body] =>
[waue_thank-you_1_Header] =>
[waue_thank-you_1_Status] =>

is part of a variable dump. This site is hosted on GoDaddy, and to send an email from a web site, one has to use a remote server (relay-hosting.secureserver.net). I am wondering if this mail server does not provide the responses necessary for logging.

Like I said, the email goes out, but there seems to be no data to log after the email transaction completes.

Sign in to reply to this post

Jason ByrnesWebAssist

in the variable dump do those variables have values?

What is the results of the variable dump?


Where are you trying to use those variables?

Poste a copy of the page for inspection please.

Sign in to reply to this post

neo314

If you open a support case, I would be happy to share the page. I do not like to post whole pages from live sites in the forum.

There seems to be some confusion, though. I started out trying to figure out why the condition didn't work, then I saw that no logging would occur, then I dumped the values to check:

<?php if ($test_mode) { // IF IN TEST MODE, DISPLAY DEBUG DATA ?>
<div style="border:solid 1px #FFFFFF; margin:10px; background-color:#FFFFFF; color:#000000;">SESSION:<pre><?php print_r($_SESSION); ?></pre></div>
<div style="border:solid 1px #FFFFFF; margin:10px; background-color:#FFFFFF; color:#000000;">POST:<pre><?php print_r($_POST); ?></pre></div>
<div style="border:solid 1px #FFFFFF; margin:10px; background-color:#FFFFFF; color:#000000;">GET:<pre><?php print_r($_GET); ?></pre></div>
<?php } ?>

The output is long, so I only posted a portion of the dump. The portion of the dump I posted shows the variables are created but have no 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...