218

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.

My powerful workflow plugin allows you to perform predefined tasks that are triggered by cronjobs or events.

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

Support

Please use the Support Forum (on the left side of the page for any theme or plugin) or send me a message. I also offer design and development services. You can visit my website for more information. Do not use reviews to ask for support.

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:

Workflows

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

Installation

  1. 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.
  2. For scheduled tasks to operate correctly, you should add a Cron entry to your server (see October CMS docs)

Workflows

Workflows are sets of actions (send mails, ping URL's) that are started by a trigger (inside your own code, by an event or from a cronjob).

Workflows have CamelCase names.

Workflows

Triggers

Triggers are used to start rules and have a type (manual, event, cronjob) and a value. Triggers can be re-used.

Manual trigger

You can call any trigger like this:

use Briddle\Workflow\Models\Workflow;
$workflow = New Workflow;
$workflow->triggerWorkflow('CamelCasedWorkflowName');

Event trigger

The event trigger type accepts the name of the event (e.g. rainlab.user.register).

Cronjob trigger

Using this trigger type requires setting up the scheduler.

The cronjob trigger type accepts values in standard crontab syntax (e.g. *****).

  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 -q /path/to/artisan schedule:run >> /dev/null 2>&1

Actions

Actions are used to perform tasks and have a type and a value. Actions can be re-used.

Actions have lowercase names.

Mail action

The mail action type accepts any raw SQL query that returns at least a name and email address. 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 }}).

Webhook action

The webhook action type accepts any full URL. If the trigger was an event and this event passed an object, you can access the parameters of that object in the URL:

https://yoursite.com?first_name&last_name

will result in pinging:

https://yoursite.com?first_name=John&last_name=Doe

Log action

The log action type accepts any value.

Query action

The query action type accepts any raw SQL query.

Examples of recipies

To email admins if they are inactive for more than 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)

To 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). If the event passed an object, you can access the parameters of that object in the URL:
https://yoursite.com?first_name&last_name

will result in pinging:

https://yoursite.com?first_name=John&last_name=Doe

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

Support

Please use the Support Forum (on the left side of the page for any theme or plugin) or send me a message. I also offer design and development services. You can visit my website for more information. Do not use reviews to ask for support.

1.3.4

Bugfix in querystring of pinging URL.

Nov 14, 2019

1.3.3

Bugfix in handling scheduled jobs and events plus support for passing event parameters to pinging URL.

Nov 13, 2019

1.3.2

Updated table briddle_workflow_actions

Oct 15, 2019

1.3.1

Updated table briddle_workflow_workflows

Oct 15, 2019

1.3.0

!!! Removed Rules in favour of Workflows (breaking changes).

Oct 15, 2019

1.2.9

Drop table briddle_workflow_rules

Oct 15, 2019

1.2.8

Rewriting and cleanup.

Oct 15, 2019

1.2.7

Updated table briddle_workflow_actions

Oct 15, 2019

1.2.6

Updated table briddle_workflow_rules

Oct 15, 2019

1.2.5

Updated table briddle_workflow_triggers

Oct 15, 2019

1.2.4

Updated table briddle_workflow_workflows

Oct 15, 2019

1.2.3

Completed translations

Oct 08, 2019

1.2.2

Added inline help sections

Oct 07, 2019

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

Upgrading from version 1.2.3

This upgrade contains breaking changes that are needed to allow me to introduce new functionality.

  • Rules have been completely replaced with Workflows, allowing you to chain multiple actions together. Any Actions and Triggers you have defined in a previous version of this plugin will still be available, but to use them you will need to replace your old Rules with new Workflows.
  • Please review the updated documentation and report any issues.