Drupal now has a messenger service, powered by the class Drupal\Core\Messenger\Messenger. Here is how you can add HTML to the message:

use Drupal\Core\Render\Markup;
\Drupal::messenger()->addStatus(Markup::create('Your settings have been saved. <a href="/">Go to the homepage</a>'));

 

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.