Well, I provide the solution, for those who may need it one day.
Look for the functions.php file of the sigma theme, and paste the following at the end before closing the php code:
if (!function_exists('usr_published_sent_email')) {
function usr_published_sent_email($item) {
if (osc_is_web_user_logged_in() && is_array($item)) {
$user = User::newInstance()->findByPrimaryKey(osc_logged_user_id());
View::newInstance()->_exportVariableToView('item', $item);
// Array con correos electrónicos y nombres
$usuarios = User::newInstance()->listAll();
// Iterar sobre los correos electrónicos y nombres del array
foreach ($usuarios as $usuario) {
if ($usuario['b_active']){
$email = $usuario['s_email'];
$name = $usuario['s_name'];
$title = 'Nuevo Articulo Publicado!';
$body = 'Hola ' . $name . ',<br>';
$body .= '<br>';
$body .= 'El usuario: <b>' . $user['s_name'] . '</b> realizo una nueva publicación<br>' . 'Para ver la publicacion del articulo "' . $item["s_title"] . '" Hace clic en: <br><br>';
$body .= '<a href="' . osc_item_url() . '">' . osc_item_url() . '</a><br>';
$body .= '<br>';
$body .= 'Saludos<br>';
$body .= '<br>';
$body .= osc_esc_html(osc_page_title()) . '<br><br>';
$emailParams = array(
'subject' => $title,
'to' => $email,
'to_name' => $name,
'body' => $body,
'alt_body' => $body
);
osc_sendMail($emailParams);
}
}
}
}
osc_add_hook('posted_item', 'usr_published_sent_email');
}