close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Odd behaviour of Universal Email

Thread began 4/09/2013 8:50 pm by mrs | Last modified 4/10/2013 11:32 am by Jason Byrnes | 320 views | 6 replies |

mrs

Odd behaviour of Universal Email

I am struggling to get Universal Email to work for me in some ways. It's for a job website where people apply directly to an employer rather than through the agency. I am trying to notify the employer they have a new application for job XYZ and it's being emailed to their specified email address entered in the DB.

The from address is that from the submitted form. The 'To' address coming from a recordset, and I have also been adding and removing a second hard coded To address to test for sure. The thing is, the email only triggers when the hard coded address is there. If I remove the hard coded address, nothing seems to happen, or I think it's gong to another email address from another record even though the correct record has been loaded into the form page.

Also, the subject isn't being filled in by the DB. It's blank all the time. Just to clarify, I am receiving an email to the DB driven address only when a hard-coded email exists, therefore I assume it is pulling some data through the recordset to the email behaviour, but not all of the info

The recordset I am working with is called rs_vacancy and I've added 'global $row_rs_vacancy;' to the Blank_3.php created by UE, but no joy. I am also dumping the results of the emailing to the thank you page and it's showing that it's working as far as sending is concerned, but I can't see the correct email address that should be pulled from the DB.

I've attached the files in question to see if you can see anything wrong.

Thanks

Sign in to reply to this post

mrs

Just to let you know, I have temporarily removed the <?php @session_start(); var_dump($_SESSION); ?> in the thank you page just in case somebody tries to use the site! For the moment, the agency will have to forward emails from the hard coded address.

Sign in to reply to this post

mrs

I have been through the PowerStore I have to see if there might be any clues I might find in there as to why my emails aren't pulling the correct data through, but I can only see similar code to what I have already implemented. So, I am wondering if my MySQL select query is wrong in some way even though it is displaying the correct data on the form page. I don't know really, I am just clutching at straws now!

Sign in to reply to this post

Jason ByrnesWebAssist

The main concept that is preventing your page from working is variable persistence.

when the page loads, you are passing it a querystring variable:
direct_enquiry.php?fld_id=23

the action of the form does not pass that querystring variable though, so look at it this waY

Page Loads (fld_id=23) shows the correct recordset info.

Submit Form, action is direct_enquiry.php this reloads the page, but the fld_id querystring is not present, so the recordset is empty.

the form has been submitted, so it triggers the email behavior, but the recordset is empty so it's not working.

use the following code for the form action to force it to retain the querystring variable:

php:
 action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != ""?"?".htmlentities($_SERVER["QUERY_STRING"], ENT_QUOTES):""); ?>"
Sign in to reply to this post

mrs

Aha! OK, I'll give that a go.

For future reference, is this something that Universal Email is NOT able to handle, or have I just missed it in the wizard somewhere?

As always, thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

It has nothing to do with Universal Email.

It has to do with the form.

The form has no way of knowing that you are going to need the URL Variables on submit. and unless you need them, you should not pass them.

If you do need them, you will need to modify the form action to include them.

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