Pimcore\Tool\Newsletter::addNoteOnObject PHP Method

addNoteOnObject() public method

public addNoteOnObject ( $object, $title )
$object
$title
    public function addNoteOnObject($object, $title)
    {
        $note = new Model\Element\Note();
        $note->setElement($object);
        $note->setDate(time());
        $note->setType("newsletter");
        $note->setTitle($title);
        $note->setUser(0);
        $note->setData(["ip" => ["type" => "text", "data" => Tool::getClientIp()]]);
        $note->save();
    }