0 users online. Create an account or sign in to join them.Users

Search

Is there a way to execute front-end events in the backend?

I have some user generated content website; they're submiting some documents that needs to be reviewed by administrators.

They have a status select-box, and based on administrator selection, on "Save entry", an event (like Send Email Template") should be executed to notify document's owner.

Thank you.

If you want to send an email template you could do it a bit of a hacky way through the backend I guess.

Create a Frontend Event to which you attach your email template (can be anything really) and append the Email Template to this event

Through an extension subscribe to the "Post Entry Save" delegate and check that it's the entry which you want that is being saved. Create an 'instance' of the frontend event you would like to post then run the following code to hit the frontend delegate. For the Entry you can pass the newly created entry which is passed through the initial delegate. I'm sure there might be a cleaner way but this should work.

$filter_results = array();
$filter_errors = array();
/**
 * @delegate EventFinalSaveFilter
 * @param string $context
 * '/frontend/'
 * @param array $fields
 * @param string $event
 * @param array $messages
 * @param array $errors
 * @param Entry $entry
 */
Symphony::ExtensionManager()->notifyMembers(
    'EventFinalSaveFilter', '/frontend/', array(
        'fields'    => array(),
        'event'     => $eventInstance,
        'messages'  => $filter_results,
        'errors'    => &$filter_errors,
        'entry'     => $entry
    )
);

:) I want backend funtionality not front-end. I found http://symphonyextensions.com/extensions/backend_action which is close to my needs.

Ah re-reading this again. If you want to submit documents, I'd still go for a post save delegate but I guess backend action would still do the trick.

I helped write an experimental extension many years ago called Jet Pack that offered this functionality. It has some dependencies on Email Template Manager and Author Roles and I have no idea if it works anymore, but it might be a starting point for you?

I used backend_action , thank you anyways ;)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.1
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details