<p>I think <a href="https://docs.craftcms.com/api/v3/craft-behaviors-sessionbehavior.html#method-setnotice" rel="nofollow noreferrer">setNotice</a> is what you're after;</p>

<p><code>Craft::$app-&gt;getSession()-&gt;setNotice('Your message');</code></p>

CC BY-SA 4.0
2019-10-17T14:23:53.370Z
2019-10-17T14:23:53.370Z
dmatthams
<p>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.</p>

<p>The background process itself runs smoothly, no problems at all there. </p>

<p>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. </p>

<p>However I can't seem to find out how I can trigger such a message.</p>

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

<craft3><control-panel>
Flash message in control panel
# Flash message in control panel

(Asked by: username_0 on 2019-10-17)

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.

**Tags:** craft3, control-panel


---

## 1 answers

### Answer by username_1 on 2019-10-17. Score: 2

I think [setNotice](https://docs.craftcms.com/api/v3/craft-behaviors-sessionbehavior.html#method-setnotice) is what you're after;

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


---

