87

Product support

Get help in the plugin support forum.

Categories

Note: This plugin is experimental and currently in beta status. "Beta" simply means that it is still in a development phase, it is only public for reasons of testing. This plugin works great with my Room Booking plugin and CRM plugin.

Features

My powerful workflow plugin allows you to create rules that trigger actions or workflows under specific conditions.

A rule allows a trigger (from your own code, by an event or from a cronjob) to prompt an action (send mails, log, ping URL's, workflow, query). You can even chain multiple actions together.

Examples

  • Send a customized email a day before (or a day after) the arrival of guests (cronjob > email)
  • Ping URL (e.g. on IFTTT) after an online payment (event > ping)
  • Update a record in the database

Installation

To install from the Marketplace, click on the "Add to Project" button and then select the project you wish to add it to before updating the project in the backend of your website to pull in the plugin.

To install from the backend, go to Settings -> Updates & Plugins -> Install Plugins and then search for Briddle.Workflow.

Like this plugin?

If you like this plugin, you can help me to develop it further, provide support for it or make new plugins by making a donation with PayPal (left side of the page) or giving this plugin a good review :).

My other plugins include:

Hello, I am Wiego Bergsma. Please start by reading the whole documentation! If you have any questions, find a bug or experience difficulties getting the plugin to work please use the Support Forum. Only leave a Review if you are happy with the plugin or are still unhappy with the plugin after reaching out to me in the Support Forum. Thank you! Wiego

Getting started

  1. Install Briddle.Workflow
  2. For scheduled tasks to operate correctly, you should add a Cron entry to your server (see October CMS docs)

Rules

All rules consist of a trigger and an action. You can de-activate a rule or chain multiple actions together in a workflow (taking care not to create loops!).

Every rule has a CamelCased name (make it descriptive!).

Rules

Rules

Triggers

All triggers consist of a type (cronjob, event, manual) and an optional value. Triggers can be reused in multiple rules.

You can call any trigger like this:

use Briddle\Workflow\Models\Rule;
$rule = New Rule;
$rule->triggerRule('CamelCasedRuleName');

Triggers of the type cronjob are triggered automagically and the value of cronjobs consist of 5 numbers that are seperated by spaces (you can also use * to include all options for the entry).

  1. Entry: Minute when the process will be started [0-60 or *]
  2. Entry: Hour when the process will be started [0-23 or *]
  3. Entry: Day of the month when the process will be started [1-28/29/30/31 or *]
  4. Entry: Month of the year when the process will be started [1-12 or *]
  5. Entry: Weekday when the process will be started [0-6 or *] (0 is Sunday)

For scheduled tasks to operate correctly, you should add the following Cron entry to your server:

php-cli -q /path/to/artisan schedule:run >> /dev/null 2>&1

Triggers

Triggers

Actions

All actions consist of a type (mail, webhook, log, workflow, query) and a value. This value can be a full URL (in case of a webhook) or a raw SQL select query (in the case of an automated mailing or query) or a name (in case of a workflow). Actions can be reused in multiple rules.

Every action has a (lowercase and space-less) name (make it descriptive!). In the case of mailings the identification code for the action also corresponds to the code for a mail template. The database record will be available within the mail template (e.g. {{ name }}).

Actions

Examples

To email admins if they are inactive for more then a week:

  1. Create a trigger of type cronjob and specify a value for the cronjob
  2. Create an action of type mail and make sure you setup a mail template using the identification code of the action.
  3. The Action value is a query that should return an array of objects and has to include the properties email and name (as they will be used for sending the mails). This array is also available in the mail template.

SELECT email as email, first_name as name FROM backend_users WHERE is_activated=1 AND last_login < DATE_SUB(NOW(), INTERVAL 1 day)

To ping a URL (e.g. after making a payment)

  1. Create a trigger of type manual
  2. Create an action of type webhook
  3. The Action value is the URL you want to ping (e.g. https://mysite.com/webhook)
  4. Call the trigger in your own code (e.g. within the onStart() function in the code section of a page)

Send an email (e.g. when a new user registers)

  1. Create a trigger of type event and specify a value for it (e.g. rainlab.user.register)
  2. Create an action of type mail and make sure you setup a mail template using the identification code of the action.
  3. The Action value is a query that should return an array of objects and has to include the properties email and name (as they will be used for sending the mails). This array is also available in the mail template.

To ping a URL (e.g. after registration)

  1. Create a trigger of type event and specify a value for it (e.g. rainlab.user.register)
  2. Create an action of type webhook
  3. The Action value is the URL you want to ping (e.g. a webhook at IFTTT.com)

List of events fired by October CMS and popular plugins

Plugin Event
- auth.login
- auth.logout
User rainlab.user.beforeAuthenticate
User rainlab.user.login
User rainlab.user.logout
User rainlab.user.deactivate
User rainlab.user.reactivate
Book briddle.book.bookings
Book briddle.book.paid
Book briddle.book.imported
Forum rainlab.forum.topic.post
Forum rainlab.forum.topic.create

List of some of the Core events fired by Laravel

  • eloquent.saving
  • eloquent.saved
  • eloquent.deleting
  • eloquent.deleted
  • eloquent.updating
  • eloquent.updated
  • eloquent.creating
  • eloquent.created

Use like: eloquent.saved: Author\Plugin\Models\Model

Permissions

As always you can set permissions for this plugin in Settings > Administrators

1.2.1

Added query action

Nov 02, 2018

1.2.0

Major improvement in triggering multiple actions now in beta

Oct 05, 2018

1.1.12

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.11

Updated table briddle_workflow_rules

Oct 05, 2018

1.1.10

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.9

Updated table briddle_workflow_rules

Oct 05, 2018

1.1.8

Drop table briddle_workflow_rule_workflow

Oct 05, 2018

1.1.7

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.6

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.5

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.4

Created table briddle_workflow_rule_workflow

Oct 05, 2018

1.1.3

Updated table briddle_workflow_workflows

Oct 05, 2018

1.1.2

Created table briddle_workflow_workflows

Oct 05, 2018

1.1.1

Fixed bug triggering next rule from log action and added backend translations

Oct 04, 2018

1.1.0

Added Log action and some bugs squashed

Sep 22, 2018

1.0.15

Updated table briddle_workflow_rules

Sep 17, 2018

1.0.14

Updated table briddle_workflow_rules

Sep 17, 2018

1.0.13

Updated table briddle_workflow_rules

Sep 17, 2018

1.0.12

Updated table briddle_workflow_rules

Sep 17, 2018

1.0.11

Updated table briddle_workflow_actions

Sep 17, 2018

1.0.10

Updated table briddle_workflow_triggers

Sep 17, 2018

1.0.9

Updated table briddle_workflow_triggers

Sep 17, 2018

1.0.8

Updated table briddle_workflow_triggers

Sep 17, 2018

1.0.7

Updated table briddle_workflow_actions

Sep 17, 2018

1.0.6

Updated table briddle_workflow_triggers

Sep 17, 2018

1.0.5

Updated table briddle_workflow_actions

Sep 17, 2018

1.0.4

Created table briddle_workflow_triggers

Sep 17, 2018

1.0.3

Created table briddle_workflow_actions

Sep 17, 2018

1.0.2

Created table briddle_workflow_rules

Sep 17, 2018

1.0.1

Initialize plugin.

Sep 17, 2018