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: [Dave] Run on save.

By markr - February 8, 2010

Thanks. Sounds good. I'll look for it in 2.03