We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12146
    • 7 Posts
    I am using TV’s for custom drop-downs in a resource page.

    Whenever the manager user authorized to edit that page makes a change to the resource, an e-mail is fired off to the site admin. I am using the OnDocFormSave event to do this, as per a very helpful example I found here: http://modxrules.com/articles/send-email-notifications-when-a-document-is-saved

    Now, I need to include in this e-mail a before and after list of TV values, so that the site admin can see exactly what was changed. How can I do this?

    Thanks.

      • 12146
      • 7 Posts
      In case anyone is interested, I went ahead and worked out a solution for this myself using plug-ins.

      In a nutshell, I created a plug-in which is fired OnBeforeDocFormSave. This plug-in takes a snapshot of the various document field contents, including TV values, before the resource is saved. I save all this to a table created purposely.

      After the resource is saved, I fire another plug-in OnDocFormSave, which queries the tables for the before and after values, and e-mails all this off to the site admin.

      Should anyone be interested in getting more details as to how I worked around this, just ask. Personally I’d still be very interested to know if there is a better solution.

      Thanks.