In short, I've got an extra background process running that syncs content for a given section to an external application as well whenever an entry in that section is saved and a certain toggle is set on that entry.

The background process itself runs smoothly, no problems at all there.

However I get a lot of questions from the end users saying they'd like to see some visual clue (besides the added job in the background processes queue) at the bottom of the sidebar. So I thought I'd show them a notice like you see when you save an entry (small blue bar at the top of the screen) indication when the external sync is triggered.

However I can't seem to find out how I can trigger such a message.

So I've got an Event::On block that does all the needed checks and triggers the jobs, and I'd like to expand that so it also shows a message.


I think setNotice is what you're after;

Craft::$app->getSession()->setNotice('Your message');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.