You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2018-11-01 00:46:00

smlabonia
Member
Registered: 2018-11-01
Posts: 4

Modificar template de emails

Estimados,

Antes que nada les agradezco la posibilidad de utilizar una herramienta open source como GLPI. Nos hace a todos involucrarnos en una comunidad para comprender su funcionamiento, implementarla, parametrizarla y mejorarla conjuntamente.

Mi pregunta puntual es la siguiente, sobre todo para aquellos que hace tiempo que siguen este proyecto:

Si bien encontré información sobre la personalización de los templates de email, en ningún caso se explica con algo de detalle el estado de la funcionalidad y las capacidades de personalización sin tocar el código. Muchos moderadores han respondido a consultas de muy mala gana (no aquí al menos que yo haya visto), como si la misma consulta hubiera sido realizada miles de veces y fueramos los usuarios (con quienes me identifico) quienes agotáramos su paciencia por nuestra ignorancia.

Por ejemplo, en muchos casos se decía que desde la misma herramienta se puede quitar el mensaje de "GLPI vX.XX...", sin embargo para quitarlo tuve que modificar archivos de código.

Agradecería quien pudiera explicarme al respecto, y propongo de hecho generar un topico único para este tema, donde podamos hacer una recopilación para los usuarios futuros que necesiten más conocimiento sobre el tema.

Gracias por el tiempo!

Offline

#2 2018-11-01 01:55:57

smlabonia
Member
Registered: 2018-11-01
Posts: 4

Re: Modificar template de emails

Adjunto la respuesta a mi propia consulta, pues estuve investigando más a fondo y casi por casualidad di con la respuesta:

Entramos al menú: Configuración-> Notificaciones-> Notificaciones

Ahí figuran una lista de las notificaciones que se envían, con un detalle de la acción que desencadena el evento. Yo los filtro por el campo "Tipo" para verlos agrupados a mi gusto.

Ingreso, por ejemplo, a "Add Follow Up", o "Nuevo seguimiento" -> Plantillas -> Tickets -> Traducción por defecto.

Ahí encuentro, en el campo de texto con formato HTML, un ícono con el símbolo "<>" que normalmente significa código, pero hasta ahora no lo había notado. Me abre una pantalla con el código HTML actual de la notificación, el cual copié a Sublime Text 3 y lo reindenté a mi gusto, de un modo que sea más legible y tomando algunas consideraciones con las etiquetas ## {Operación lógica propia de GLPI} ## para darle mejor sentido al código. Lo adjunto a continuación para aportar a la causa.

Creo que el código de esta manera se entiende mucho mejor y es más lógico el proceso de armado de la notificación para adaptarlo a nuestro gusto.

Cabe aclarar que muchas notificaciones usan esta misma plantilla, porque considera variables y actúa en consecuencia.

Código wrote:

<!-- description{ color: inherit; background: #ebebeb; border-style: solid;border-color: #8d8d8d; border-width: 0px 1px 1px 0px; }    -->
##IFticket.storestatus=5##
<div>
    <div>
        ##lang.ticket.url## : <a href="##ticket.urlapprove##">##ticket.urlapprove##</a>
    </div>

    <div>
        <strong>##lang.ticket.autoclosewarning##</strong>
    </div>

    <div>
        <span style="color: #888888;"><strong><span style="text-decoration: underline;">##lang.ticket.solvedate##</span></strong></span> : ##ticket.solvedate##
        <br />
        <span style="text-decoration: underline; color: #888888;"><strong>##lang.ticket.solution.type##</strong></span> : ##ticket.solution.type##
        <br />
        <span style="text-decoration: underline; color: #888888;"><strong>##lang.ticket.solution.description##</strong></span> : ##ticket.solution.description##
    </div>
</div>
##ENDIFticket.storestatus##

##ELSEticket.storestatus##
<div>
    ##lang.ticket.url## : <a href="##ticket.url##">##ticket.url##</a>
</div>
##ENDELSEticket.storestatus##

<p class="description b">
    <strong>##lang.ticket.description##</strong>
</p>

<p>
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.title##</span> :##ticket.title##
    <br />

    ##IFticket.authors##
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.authors##</span> : ##ticket.authors##
    ##ENDIFticket.authors##
    ##ELSEticket.authors##
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.authors##</span> : --
    ##ENDELSEticket.authors##

    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.creationdate##</span> :##ticket.creationdate##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.closedate##</span> :##ticket.closedate##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.requesttype##</span> :##ticket.requesttype##
    <br />
    <br />

    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.item.name##</span> :</p>
        <p>##FOREACHitems##</p>
   
            <div class="description b">
                ##IFticket.itemtype##

                    ##ticket.itemtype## - ##ticket.item.name##

                    ##IFticket.item.model##
                        ##lang.ticket.item.model## : ##ticket.item.model##
                    ##ENDIFticket.item.model##

                    ##IFticket.item.serial##
                        ##lang.ticket.item.serial## : ##ticket.item.serial##
                    ##ENDIFticket.item.serial##

                    ##IFticket.item.otherserial##
                        ##lang.ticket.item.otherserial## : ##ticket.item.otherserial##
                    ##ENDIFticket.item.otherserial##

                ##ENDIFticket.itemtype##
            </div>
        <p> </p>

        <p>##ENDFOREACHitems##</p>

    <p>
        ##IFticket.assigntousers##
            <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.assigntousers##</span> : ##ticket.assigntousers##
        ##ENDIFticket.assigntousers##

        <br />
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;">##lang.ticket.status## </span> : ##ticket.status##
        <br />

        ##IFticket.assigntogroups##
            <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.assigntogroups##</span> : ##ticket.assigntogroups##
        ##ENDIFticket.assigntogroups##

        <br />
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.urgency##</span> : ##ticket.urgency##
        <br />
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.impact##</span> : ##ticket.impact##
        <br />
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.priority##</span> : ##ticket.priority##
        <br />

        ##IFticket.user.email##
            <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.user.email##</span> : ##ticket.user.email
        ##ENDIFticket.user.email##

        <br />

        ##IFticket.category##
            <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;">##lang.ticket.category## </span> :##ticket.category##
        ##ENDIFticket.category##
        ##ELSEticket.category##
            ##lang.ticket.nocategoryassigned##
        ##ENDELSEticket.category##

        <br />
        <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.ticket.content##</span> : ##ticket.content##
    </p>

    <br />
    <br />

    <p>
        ##IFticket.storestatus=6##
            <span style="text-decoration: underline;"><strong><span style="color: #888888;">##lang.ticket.solvedate##</span></strong></span> : ##ticket.solvedate##
            <br />
            <span style="color: #888888;"><strong><span style="text-decoration: underline;">##lang.ticket.solution.type##</span></strong></span> : ##ticket.solution.type##
            <br />
            <span style="text-decoration: underline; color: #888888;"><strong>##lang.ticket.solution.description##</strong></span> : ##ticket.solution.description##
            <br />
        ##ENDIFticket.storestatus##
    </p>

<div class="description b">##lang.ticket.numberoffollowups## : ##ticket.numberoffollowups##</div>

<p>##FOREACHfollowups##</p>
<br />
<div class="description b">
    <strong> [##followup.date##] <em>##lang.followup.isprivate## : ##followup.isprivate## </em></strong>
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.followup.author## </span> ##followup.author##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.followup.description## </span> ##followup.description##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.followup.date## </span> ##followup.date##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.followup.requesttype## </span> ##followup.requesttype##
</div>
<p>##ENDFOREACHfollowups##</p>

<div class="description b">
    ##lang.ticket.numberoftasks## : ##ticket.numberoftasks##
</div>

<p>##FOREACHtasks##</p>
<br />
<div class="description b">
    <strong> [##task.date##] <em>##lang.task.isprivate## : ##task.isprivate## </em></strong>
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.task.author##</span> ##task.author##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.task.description##</span> ##task.description##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.task.time##</span> ##task.time##
    <br />
    <span style="color: #8b8c8f; font-weight: bold; text-decoration: underline;"> ##lang.task.category##</span> ##task.category##
</div>
<p>##ENDFOREACHtasks##</p>

Espero que les sea de ayuda y no tengan que luchar tanto como yo!

Offline

Board footer

Powered by FluxBB