Closed smartscripts-nl closed 2 years ago
Yes, you can hook in to the Message model's beforeSave
event
Model::extend(function ($model) {
$model->bindEvent('model.beforeSave', function () use ($model) {
$model->content_html = processHtml($model->content_html);
});
});
My customer has the habit of sometimes typing multiple spaces between words. In the resulting email that looks very ugly.
So I would like to have a method like beforeSave(), that would enable me to manipulate the HTML before it is being saved. Or does such a method already exist? If so, how can I call it?