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 2017-04-04 08:15:49

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Tags for email notifications

Hello. Where i can find full list of all supported tags for email notifications?
If think list in the "Show all supported tags" in template translation page not actually full. There is no "IF" tags.
Or i can use this "IF" prefix with all availiable tags?

Have a nice day. smile


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

#2 2017-04-04 10:11:37

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Re: Tags for email notifications

Ok. I can use IF,ENDIF etc. statements with any tags. It's good.
But with erference to this post http://forum.glpi-project.org/viewtopic … 93#p330593
Is the FOREACHLAST special prefix like IF etc.? Is there any list of all special prefixes.

And i have another trouble. Tags ##author.email##, ##user.phone## and same for mobile etc. wan't work in the my template. How i can debug this?
The whole construction with those tags looks like:

##IFauthor.mobile##<span style="some css">##lang.author.mobile##</span> : ##author.mobile## ##ENDIFauthor.mobile##

And it's always empty. Ofcouse those fields filled in user/author profiles.


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

#3 2017-04-04 11:12:02

haide
Guest
Registered: 2015-08-19
Posts: 10

Re: Tags for email notifications

Hi,
maybe you can help me
i'm looking for "order management" tags 'cause i want to include in notifications: quantity, equipment, manufactured,reference, type,model...

do you know something about this?

Offline

#4 2017-04-05 15:43:00

wanderlei.huttel
Guest
Registered: 2017-04-03
Posts: 3

Re: Tags for email notifications

Hello Marcelo

I guess your problem is the "logical operator" if you use "and" all conditions must be match.
Try to change logical operator for "or"

Best Regards
Wanderlei

Offline

#5 2017-04-05 22:51:03

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 13,144

Re: Tags for email notifications

You have doc for that but not translated in English.
I explain with my poor English.

You have 3 king of tags:
- simple: to show a string or the value of a field (##reservation.end## to show tha date of the end of the reservation)

- condition (IF/ELSE/THEN): to test the value of a field. The syntax is ##IFfieldname## action for the  IF ##ENDIFfieldname## ##ELSEfieldname## action for the ELSE ##ENDELSEfieldname##. ##IFticket.assigntouser## ... ##ENDIFticket.assigntouser## means if you have a technician assigned to the ticket.
You also can test the value of a field: ##IFticket.storestatus=5## means is status of the ticket is Closed

- loops (FOREACH): to list a part of a dropdown list
  * first item:  ##FOREACH FIRST followups## ... ##ENDFOREACH followups## => show only the first followup created in the ticket
  * last item: ##FOREACH LAST followups## ... ##ENDFOREACH followups##
  * 10 first items : ##FOREACH FIRST 10 followups## ... ##ENDFOREACH followups##
  * 2 last items : ##FOREACH LAST 2 followups## ... ##ENDFOREACH followups##

You can have a FOREACH in a FOREACH but you can't have an IF in a FOREACH


CentOS 6.5 - PHP 5.6 - PHP 7 - MySQL 5.6  + APC + memcached
GLPI 0.90.5 SVN - GLPI 9.1.3 SVN
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#6 2017-04-06 09:37:54

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Re: Tags for email notifications

yllen, thank you very much, your help is very useful, as always. smile

But i have another trouble. I made template like this:

<div id="author-box">
<span id="light-text"> ##lang.ticket.authors##</span> : ##IFticket.authors## ##ticket.authors## ##ENDIFticket.authors## ##ELSEticket.authors##--##ENDELSEticket.authors## <br />
##IFauthor.email##
<span id="light-text">##lang.author.email##</span> : ##author.email##<br />
##ENDIFauthor.email##
##IFauthor.phone##
<span id="light-text">##lang.author.phone##</span> : ##author.phone##<br />
##ENDIFauthor.phone##
##IFauthor.mobile##
<span id="light-text">##lang.author.mobile##</span> : ##author.mobile##
##ENDIFauthor.mobile##
</div>

But email, phone, mobile is always empty, even if the requester have those fields filled. As empty i mean there is no line at all, not only value.
So on the email notification I have only one line "Requesters: User Name"

Can you help me with that? Thank you.

Last edited by freewood (2017-04-06 10:48:32)


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

#7 2017-04-17 08:55:18

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Re: Tags for email notifications

Any help appreciated )


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

#8 2017-04-25 08:02:57

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Re: Tags for email notifications

On the fresh installation of GLPI i have the same problem. I think there is a misstake in notification template, but can't find where it is.
My problem is, tags like "##lang.author.email##" doesn't work, it's always empty in notification emails.


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

#9 2017-04-25 19:11:45

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 13,144

Re: Tags for email notifications

I have no problem.
Tags of my test:

##FOREACHauthors##

Requester: ##ticket.authors##
Email : ##author.email##
Phone: ##author.phone##
Mobile: ##author.mobile##

##ENDFOREACHauthors##

CentOS 6.5 - PHP 5.6 - PHP 7 - MySQL 5.6  + APC + memcached
GLPI 0.90.5 SVN - GLPI 9.1.3 SVN
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#10 2017-04-26 07:53:25

freewood
Guest
From: Moscow
Registered: 2016-01-30
Posts: 96

Re: Tags for email notifications

The key was ##FOREACH... statement. Thank you again. smile


Debian Stretch + nginx 1.10.3 + php7.0-fpm
GLPI v9.1.4 + Reports, OCS, Browser notifications, Behaviors, Forms

Offline

Board footer

Powered by FluxBB