8 – How to customize a link with a custom module?

I have installed the module "Private Message" on Drupal 8.

There is a link to send a message that I want to turn into a Bootstrap button.

How to customize a link on Drupal 8?

Here is the HTML code of the link:

The developer of "Private Message" gave me this code, but I do not know what to do with it.

I need to create a custom module or put it in mon_theme.info.yml ?

function HOOK_node_view_alter (& $ build) {
to build['private_message_link']['#title']    = t (& # 39;) Click me. Click me now!

The developer of the module wrote in a comment:

You can implement hook_ENTITY_TYPE_view_alter (). For example, if you edit the link on the user profile, you must implement hook_user_view_alter (). If you change the link on the nodes, you must implement hook_node_view_alter (). If you edit the comment link, you must implement hook_ENTITY_TYPE_view_alter ().

In this function, you can modify the output of the link by modifying $ build['private_message_link'] as you see fit

I created a custom module:

private_message_contact_button.module :

<? php

/ **
* @file
* Hook the implementations of the private_message_contact_button module.
* /

use Drupal  Core  Entity  Display  EntityViewDisplayInterface;
use Drupal  Core  Entity  EntityInterface;

function private_message_contact_button_node_view_alter (& $ build) {
to build['private_message_link']['class']    = array (& nbsp; button button - primary & # 39;; & bt; & bt; & nbs;);

The code works, but the button is not applied.

I want to add the class btn btn-success

And I want to add a make awesome icon in front of the text

I have to put what as code?