close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Customize email subject with data from form fields?

Thread began 1/16/2017 3:41 pm by art226587 | Last modified 1/18/2017 12:34 pm by Ray Borduin | 295 views | 4 replies |

art226587

Customize email subject with data from form fields?

Hi, I've built a form that captures info in to a db and then emails the form contents to an array of recipients. All is working fine, however, my client informed me that they would like some data from the form to be included in the subject line. Currently, all submissions have the same generic subject line. Looking at my form page, I see this:

$_SESSION[$EmailRef."_Subject"] = $GLOBALS[$EmailRef."_Subject"];



But, I also see places in the waeu insert PHP page as well as the template PHP page that got created where the subject is supposedly specified. Hence my confusion. Any suggestions?

Thanks in advance!
Art

Sign in to reply to this post

Ray BorduinWebAssist

The subject line is set on the first few lines of the included email file. This line is not significant in terms of updating the value.

Sign in to reply to this post

art226587

Thanks, Ray. I see the following line in the waue insert php file, which I've previously customized with my generic subject:

$MailSubject     = "New Request Received";



I'm just not sure how to modify this to include one or two of the data fields since that file doesn't seem to contain any db connection info, just the email configuration stuff. Normally I'd include something like "echo($row_WADAmy_table['my_field']);" but I can't imaging that would work on this page for the aforementioned reason. Any pointers on where/how to pull field data into the subject line?

Thanks,
Art

Sign in to reply to this post

Ray BorduinWebAssist

Data from the form is referenced like: $_POST['FormFieldName']

So including data from the form into the subject would be done like:

php:
$MailSubject     = "New Request Received from " . $_POST['FromEmail']  ," using the online form";
Sign in to reply to this post

art226587

That works perfectly! Thanks for your help, Ray.

Art

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