• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

application.cfc and email notification

Explorer ,
Jun 10, 2012 Jun 10, 2012

Copy link to clipboard

Copied

I posted this a couple weeks ago in the general coldfusion forum but got no replies.  If what I'm asking is impossible, I'd appreciate it if you'd just let me know--or if there's a different way to do what I want that I'm unaware of.  Thanks.

------------------------------------------------------------------

I'm in the process of finishing a website and it is heavily dependent on user interaction.  It has lots of different forms and message board and, when I launch it, I'd really like to be notifvied by email whenever someone posts anything on any page of the site, so I can respond in the early going before many people have started to use the site.

Currently, I have email notification set up for private messages sent from user to user, so I know how to do that.  But it would be a real pain to have to go through every page on the site that has a form and insert the code that notifies me whenever something is posted.  I only need to do this with me--I just want to know whenever someone posts, nobody else but me has to know whenever someone posts anything on the site.


So my question is, is there some way I can insert some code into application.cfc to notify me whenever anyone posts anything so I don't have to go through every single page and insert the code myself

Or maybe there is a way to do it that doesn't involve application.cfc, I don't know.  Anything that does what I'm asking will be greatly appreciated.

TOPICS
Advanced techniques

Views

752

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 10, 2012 Jun 10, 2012

Copy link to clipboard

Copied

You can do lot's of things in Application.cfc.  If posting is done by form, in your onRequestStart method, you can do something like:

if (structkeyexists(form,"fieldnames") is true)

send mail to yourself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2012 Jun 10, 2012

Copy link to clipboard

Copied

Thanks,

I'm not all too advanced with coldfusion--I've kind of been learning as I go, so, in the bit of code you gave me above, do I need to actually include every different form name or does "fieldnames" cover any form on any page?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 10, 2012 Jun 10, 2012

Copy link to clipboard

Copied

LATEST

Submit a form to a page with only this code:

<cfdump var-"#form#">

Then you'll know whether or not my answer was correct. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation