[opencms-dev] email notification triggered by content chage

Kai Widmann Widmann at mediaworx.com
Fri Jul 11 09:57:46 CEST 2014


Ah, and one more thing, if you need to get to the changed resource, you can get it through the event data.
I've integrated this in the sample code below.

  public void cmsEvent(CmsEvent event) {
    int eventType = event.getType();
    Map<String, Object> eventData = event.getData();

    if (eventType == I_CmsEventListener.EVENT_RESOURCE_MODIFIED) {
      int changeType = (Integer)eventData.get(I_CmsEventListener.KEY_CHANGE);
      if (changeType == CmsDriverManager.CHANGED_CONTENT) {
        CmsResource changedResource = (CmsResource)eventData.get(I_CmsEventListener.KEY_RESOURCE);
        [... send your email here ...]
      }
    }
  }


Cheers

Kai 

-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Kai Widmann
Gesendet: Freitag, 11. Juli 2014 09:53
An: kuku at physik.rwth-aachen.de; The OpenCms mailing list
Betreff: Re: [opencms-dev] email notification triggered by content chage

Hey there, 

I don't know if it's possible without programming, but I know that this could be done by implementing a module action class (I_CmsModuleAction).
In the Method "cmsEvent" you can listen to events. That's how this method could look like: 


[...]

Cheers

Kai


-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Christoph Kukulies
Gesendet: Freitag, 11. Juli 2014 09:42
An: The OpenCms mailing list
Betreff: [opencms-dev] email notification triggered by content chage

Hi,

is it possible to trigger an email to the site admin when some update occurs by an OpenCMS-user?

--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de _______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev



_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your list options, or to unsubscribe from the list, please visit http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list