Run on save.

5 posts by 3 authors in: Forums > CMS Builder
Last Post: February 8, 2010   (RSS)

By markr - January 30, 2010

I want to run some code after updating a record? Is there an onUpdate event handler?

I see a ref to "record_postsave" in the forum as an added plugin but how do I access that?

Re: [markr] Run on save.

By Chris - February 2, 2010

Hi markr,

Plugin development is some pretty advanced stuff. If you don't have any other plugins to examine, download our free MySQL Console plugin to see how plugin "actions" work.

To access the "record_postsave" hook, you'll need to use addAction(). You'll also want to familiarize yourself with how the code which calls that action works.

Out of curiousity, what is it that you want to accomplish?
All the best,
Chris

Re: [markr] Run on save.

By markr - February 3, 2010

I have a short weather bulletin on a page that is updated manually using cmsb. When the client updates that field I would like the content to be emailed to a list of email addresses using phpmailer.

Not unlike the cmsb twitter addon, except email.

I may have gotten this idea from something called tweetymail which found while browsing the web one night. I'm sure there are others.

I use phpmailer a lot and I thought it would be easy to use the weather content as the body for a mail out.

Anybody done something like this?

Re: [markr] Run on save.

By Dave - February 8, 2010

Hi markr,

We'll be releasing a free plugin with the next release (v2.03) called "Create Record Here" which adds a link to the record list page. It also runs some code on record save, though, so it would have some great example code for you to build your emailer with.

If you're not already on our beta list and you'd like to join feel free to email me at dave@interactivetools.com with your email.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com