{$_title = "[`Create automation rule`]"} {if !empty($notification.id)} {$_title = "[`Edit automation rule`]"} {/if} {* @event backend_settings_notification_edit.%plugin_id%.top *} {if !empty($backend_settings_notification_edit)} {foreach $backend_settings_notification_edit as $_}{ifset($_.top)}{/foreach} {/if} {$_back_uri = "{$wa_app_url}settings/notifications/"}

{$_title}

{* EVENT *}
[`Event`]
{if empty($notification.id)} {else} {$events[$notification.event]|default:$notification.event|escape} {/if}
{* COMPANY *} {$_is_invoice_event = substr($notification.event|default:'', 0, 8) === 'invoice.'} {$_is_deal_event = substr($notification.event|default:'', 0, 5) === 'deal.'} {if empty($notification.id) || $_is_invoice_event}
[`Company`]
{/if} {if empty($notification.id) || $_is_deal_event}
[`Funnel`]
{/if} {* NAME *}
[`Rule name`]
{* STATUS *}
[`Enabled`]
{* TRANSPORT *}
[`Action`]
{if empty($notification.id)}
    {foreach $transports as $_transport_id => $_transport} {$_is_active = false} {if !empty($notification.transport)} {if $notification.transport == $_transport_id} {$_is_active = true} {/if} {elseif $_transport@first} {$_is_active = true} {/if}
  • {/foreach}
{else} {$_transport = $transports[$notification.transport]|default:[]} {if !empty($_transport.icon)} {/if} {$_transport.name|default:'[`Unknown`]'} {/if}
{if empty($notification.id) || in_array($notification.transport, [crmNotificationModel::TRANSPORT_EMAIL, crmNotificationModel::TRANSPORT_SMS])}
[`Recipient`]
{$_recipient_email_value = ''} {if !$_found_recipient && $notification.id > 0 && $notification.transport === 'email'} {$_recipient_email_value = $notification.recipient} {/if} {$_recipient_phone_value = ''} {if !$_found_recipient && $notification.id > 0 && $notification.transport === 'sms'} {$_recipient_phone_value = $notification.recipient} {/if}
{/if} {if empty($notification.id) || $notification.transport === crmNotificationModel::TRANSPORT_REMINDER} {/if} {* BODY *}
{* for email *} {if empty($notification.id) || $notification.transport == crmNotificationModel::TRANSPORT_EMAIL}
[`Email subject`]
[`Email body`]

HTML + Smarty

{/if} {* for phone *} {if empty($notification.id) || $notification.transport == crmNotificationModel::TRANSPORT_SMS}
[`SMS content`]
[`Max 300 chars.`]
{/if} {* for http *} {if empty($notification.id) || $notification.transport == crmNotificationModel::TRANSPORT_HTTP}
[`Request URL`]
[`Enter the URL to which requests will be sent.`]
[`Request method`]
[`HTTP headers`]
[`GET parameters`]
[`POST parameters`]
[`Data sending format`]
{/if} {if empty($notification.id) || $notification.transport == crmNotificationModel::TRANSPORT_REMINDER}
[`Due date after`]
[`days`]
[`Reminder type`]
[`Reminder content`]
{/if}
{capture assign="_dialog_template"}
{if empty($notification.id) || $notification.transport !== crmNotificationModel::TRANSPORT_REMINDER} [`Send to`]: {/if} {if empty($notification.id) || $notification.transport === crmNotificationModel::TRANSPORT_REMINDER} {/if}
{if empty($notification.id) || $notification.transport !== crmNotificationModel::TRANSPORT_REMINDER} {/if} {if empty($notification.id) || $notification.transport === crmNotificationModel::TRANSPORT_REMINDER} {/if}
{/capture} {capture assign="_success_html"}

[`Message sent successfully`]

{/capture}
{* @event backend_settings_notification_edit.%plugin_id%.bottom *} {if !empty($backend_settings_notification_edit)} {foreach $backend_settings_notification_edit as $_}{ifset($_.bottom)}{/foreach} {/if}