Hi Quentin,
I try to recover categories or groups dynamically with provider "mail" but I can't find the good syntax for it.
It works with provider "Footprints"... I suppose it's due to the syntax HTML but i don't find where is the pb.
Can you help me?
Here is the body of providers "Footprints":
`{$user.alias} open ticket at {$smarty.now|date_format:"%d/%m/%y %H:%M:%S"}
{$custom_message}
Catégorie=Disque
{include file="file:$centreon_open_tickets_path/providers/Abstract/templates/display_selected_lists.ihtml" separator=""}
{if $host_selected|@count gt 0}
{foreach from=$host_selected item=host}
Host: {$host.name}
State: {$host.state_str}
Duration: {$host.last_hard_state_change_duration}
Output: {$host.output|substr:0:1024}
{/foreach}
{/if}
{if $service_selected|@count gt 0}
{foreach from=$service_selected item=service}
Host: {$service.host_name}
Service: {$service.description}
Service_id={$service.service_id}
State: {$service.state_str}
Duration: {$service.last_hard_state_change_duration}
Output: {$service.output|substr:0:1024}
{/foreach}
{/if}
{service_get_servicegroups host_id=$service.host_id service_id=$service.service_id}
service groups linked:
{foreach from=$service_get_servicegroups_result key=sg_id item=i}
id: {$sg_id} name = {$i.name}, alias = {$i.alias}
{/foreach}
{host_get_hostgroups host_id=$service.host_id}
host groups linked:
{foreach from=$host_get_hostgroups_result key=hg_id item=i}
id: {$hg_id} name = {$i.name}
{/foreach}
{service_get_servicecategories service_id=$service.service_id}
service categories linked:
{foreach from=$service_get_servicecategories_result key=sc_id item=i}
{if $i.description|substr:0:5 neq 'Type_'}
Catégorie={$i.name}
{else}
Catégorie=Autre
{/if}
{/foreach}`
Here is the body of provider "Mail":
`
{$user.alias} open ticket at {$smarty.now|date_format:"%d/%m/%y %H:%M:%S"}
{$custom_message}
Catégorie=Disque
{include file="file:$centreon_open_tickets_path/providers/Abstract/templates/display_selected_lists.ihtml" separator=""}
{if $host_selected|@count gt 0}
{foreach from=$host_selected item=host}
Host: {$host.name}
State: {$host.state_str}
Duration: {$host.last_hard_state_change_duration}
Output: {$host.output|substr:0:1024}
{/foreach}
{/if}
{if $service_selected|@count gt 0}
{foreach from=$service_selected item=service}
Host: {$service.host_name}
Service: {$service.description}
Service_id={$service.service_id}
State: {$service.state_str}
Duration: {$service.last_hard_state_change_duration}
Output: {$service.output|substr:0:1024}
{/foreach}
{/if}
{service_get_servicegroups host_id=$service.host_id service_id=$service.service_id}
service groups linked:
{foreach from=$service_get_servicegroups_result key=sg_id item=i}
id: {$sg_id} name = {$i.name}, alias = {$i.alias}
{/foreach}
{host_get_hostgroups host_id=$service.host_id}
host groups linked:
{foreach from=$host_get_hostgroups_result key=hg_id item=i}
id: {$hg_id} name = {$i.name}
{/foreach}
{service_get_servicecategories service_id=$service.service_id}
service categories linked:
{foreach from=$service_get_servicecategories_result key=sc_id item=i}
{if $i.description|substr:0:5 neq 'Type_'}
Catégorie={$i.name}
{else}
Catégorie=Autre
{/if}
{/foreach}
`