Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.52 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.52 KB

Corrections

This plugin provides an editorial workflow for correction requests.

Filters

Some data filters to change the plugins behavior from outside.

Recipient suggestions

You can provide a list of recipient suggestions. These will be suggested in the Gutenberg UI.

add_filter(
    \Palasthotel\WordPress\Corrections\Plugin::FILTER_RECIPIENT_SUGGESTIONS,
    function(array $suggestions){
        return ["[email protected]", "[email protected]"];
    }
);

Message Service

The default MessageService implementation will send an email to the recipient. A custom implementation can be provided by implementing the \Palasthotel\WordPress\Corrections\Service\MessagingService interface und using the filter.

add_filter(
    \Palasthotel\WordPress\Corrections\Plugin::FILTER_MESSAGE_SERVICE,
    function(\Palasthotel\WordPress\Corrections\Service\MessagingService $service){
        return new MyMessageService();
    }
);

Customize email message

If the default MessagingService is in use there are two hooks to change the emails content.

add_filter(
    \Palasthotel\WordPress\Corrections\Plugin::FILTER_EMAIL_SUBJECT,
    function(string $subject, \Palasthotel\WordPress\Corrections\Model\Message $message){
        return "My Custom subject";
    }, 10, 2
);
add_filter(
    \Palasthotel\WordPress\Corrections\Plugin::FILTER_EMAIL_BODY,
    function(string $body, \Palasthotel\WordPress\Corrections\Model\Message $message){
        return "My Custom body";
    }, 10, 2
);