I have created my own function which is trigged for the event **sales\_order\_status\_history\_save\_after**. What I wanted to do is, when a new comment is added, the system will get the latest order comment, and send it to customer. 

I have tried using the following code,

```
    public function CommentSaveAfter()
    {
            $history = $order->getStatusHistoryCollection()->getFirstItem();
            return $history->getComment();

    }

```

However, this code only get me the last comment before the new one is added.

See screenshot, the code only get the last comment 4444, not 5555 when I click on "**Submit Comment**"
[![enter image description here](https://i.stack.imgur.com/c3drX.png)](https://i.stack.imgur.com/c3drX.png)

How can I get the latest comment when click on Submit Comment with event **sales\_order\_status\_history\_save\_after** ?

---

This question is not duplicated with [Magento event for adding order comment](https://magento.stackexchange.com/questions/25216/magento-event-for-adding-order-comment)

My problem is I can not get the comment I just added to the order comment, but only the latest comment from status\_history. I have already managed to add my own function to the event sales\_order\_status\_history\_save\_after. So it's different from the other question.