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

Emails not sending if recipient is from database

Thread began 5/31/2012 5:23 am by paul307749 | Last modified 6/01/2012 10:14 am by paul307749 | 1044 views | 10 replies |

paul307749

Emails not sending if recipient is from database

Hi,

I'm having a few issues trying to get UE 4.01 to work as intended. Here's the issue I'm experiencing:

I have a filtered recordset displayed on 1 page and each result has a button that sends the user to the page with UE4 applied to it that requires the user to fill out their query and send an email to the specific recipient who's email is supplied from the database result (filtered by using POST method).

The data is being filtered correctly and the resulting email address is being echoed out to ensure the data is being pulled out from the DB.

However, the email is not sending to the recipient. If I remove the dynamic binding from UE4 and manually input the email address it works as expected, but not when using the bound data from the database. I've tested this using various email addresses that are both on the same server and offsite (gmail, hotmail, etc.)

No errors are being generated and I'm using the mail method.

Any suggestions as to why this would be the case?

Regards

Paul

Sign in to reply to this post

Christopher WestCommunity Expert

Hi after reading this, in your description - dod you also mean that you have filtered the data on the same page as the universal email? Perhaps you could do a test where upon on the page with the universal email behaviour on - echo out the email address to show it on screen, then at least you know if the actual password field is available for use on that page since if it displays on the screen (on the universal email page) then you can use it.

Chris

Sign in to reply to this post

paul307749

Hi Chris,

The search results page filters the data based upon your search criteria and then when you click the 'Request a Callback' button, this sends the relevant ID via POST to the page that UE4 is being used.

I've set this page to output the name and email of the record to ensure that the data is being returned correctly (which it is), but the UE behaviour will not send it to the address if it is being pulled from the DB as opposed to manually inputting the email address in the UE interface.

Sorry for any confusion my orginal post may have caused :0)

Regards

Paul

Sign in to reply to this post

Christopher WestCommunity Expert

Hmmm in the universal email window for the TO input box. does the dynamic code look somethign liek this:

<?php echo ((isset($_POST["email"]))?$_POST["email"]:""); ?>

(as thats how I got mine setup)

is your recordset code BEFORE the universal email code on the same page?

Chris

Sign in to reply to this post

paul307749

Hi Chris,

Yup, the DB is setup before the UE code and the following is used for the 'TO' email address:

<?php echo $row_rsCompany['fr_Email']; ?>

As this is pulled from the DB on the page, the code you used would be applicable if the email address was being sent via POST as opposed to pulled from the filtered database recordset, unless I'm way off base with it :0)

Sign in to reply to this post

Christopher WestCommunity Expert

no your right so im stumped - Jason needs to look at your code. so you should put your php file into a zip file and then upload that file on this thread so that Jason can view it.

Chris

Sign in to reply to this post

paul307749

Cheers for the reply Chris, and I'll pop the file in a zip and upload it now. :0)

Attached Files
callback.zip
Sign in to reply to this post

Jason ByrnesWebAssist

this is really a pretty simple problem, it has to do with data persistence.

page one has a form element on it named "id", it posts to the callback.php page and filters the recordset when it is loaded.

the problem is that the form on callback.php does not post the id when it triggers UE to send the email.

the solution is to add a hidden element named "id" to the callback.php form that captures the value sent in from the initial page:

php:
<input name="id" type="hidden" id="id" value="<?php echo((isset($_POST["id"]))?$_POST["id"]:""?>" />
Sign in to reply to this post

paul307749

Hi Jason,

Thanks for the help, that worked a treat. However, it now includes the ID as an entry in the sent email as the hidden element needs to be in the form element and so gets included in the data printed in the email.

Is there any way to stop this happening?

Regards

Paul

Sign in to reply to this post

Jason ByrnesWebAssist

Yup, in the email template file (look in the webassist/email/templates folder) edit the remove array near the top:

php:
$remove = array();

$remove[]  = "";
$remove[]  = "x";
$remove[]  = "y";




and add the id element:

php:
$remove = array();

$remove[]  = "";
$remove[]  = "x";
$remove[]  = "y";
$remove[]  = "id";
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...