Difference between revisions of "Notify"

From truxwiki.com
Jump to navigation Jump to search
Line 137: Line 137:
  
 
==Send Grid==
 
==Send Grid==
Sends email notifications via a SendGrid account. You will need to setup a [https://sendgrid.com/ SendGrid] account to enable this notifier. Configurations for this notifier is nested in an "SendGrid" block.
+
Sends email notifications via a SendGrid account. You will need to setup a [https://sendgrid.com/ SendGrid] account to enable this notifier.  
 +
 
 +
Configurations for this notifier are nested in an "SendGrid" block.
  
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 12:20, 1 April 2021

Details
Executable Notify.exe
Stage 255
Percent Complete 100%
Message Queue notify


The Notify ETL is responsible for broadcasting different topics of information to different communications channels when a load completes. The progress of a load is not dependent on Notify.

When giving examples on how to configure the individual items of Notify, we will use the TruxtonSettings.xml file as an example. Configurations for notify are nested in a "Notify" block.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <!-- 
        individual notify configs here 
      -->
  </Notify>
</truxton_options>

Notifiers

The channel in which a topic will be sent. E.G. Email, SMS, Teams, etc. Each individual notifier must be configured in order to be enabled otherwise they will NOT send anything. This means each notifier is "opt-in". Configurations for each notifier is nested in a "Notifiers" block.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <!-- 
          individual notifiers configs here 
        -->
    </Notifiers>
  </Notify>
</truxton_options>

The Notify ETL contains the following notifiers out of the box:

Email

Sends email notifications via an smtp server. Configurations for this notifier is nested in an "Email" block.

Name Data Type Description
Host string The smtp host which will send the email.
Port number The smtp port to connect to the host. Optional. If omitted will default to the default smtp port: "587"
Sender string The name of the sender who sends this email
StaticRecipients string[] Who will receive this email.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <Email>
        <Host>smtp.gmail.com</Host>
        <!-- port will default to 587 (TLS), if you want SSL you need to manually specify -->
        <Port>465</Port>
        <Sender>load@mydomain.com</Sender>
        <StaticRecipients name="0">firstemail@mydomain.com</StaticRecipients>
        <StaticRecipients name="1">anotheremail@anotherdomain.com</StaticRecipients>
        <StaticRecipients name="2">andanotheremail@foo.com</StaticRecipients>
      </Email>
    </Notifiers>
  </Notify>
</truxton_options>

Microsoft Teams

Sends notifications to a Microsoft Teams instance. You will need to setup a webhook to enable his notifier. Configurations for this notifier is nested in an "MSTeams" block.

Name Data Type Description
WebhookURL string The webhook url you configured for your microsoft teams instance.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <MSTeams>
        <WebhookURL>https://MYINSTANCE.webhook.office.com/webhookb2/FOO/IncomingWebhook/BAR</WebhookURL>
      </MSTeams>
    </Notifiers>
  </Notify>
</truxton_options>

Send Grid

Sends email notifications via a SendGrid account. You will need to setup a SendGrid account to enable this notifier.

Configurations for this notifier are nested in an "SendGrid" block.

Name Data Type Description
APIKey string A sendgrid API key.
Sender string The name of the sender who sends this email via sendgrid
StaticRecipients string[] Who will receive this email.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <SendGrid>
        <APIKey>A_REALLY_LONG_SET_OF_CHARACTERS_THAT_IS_YOUR_SEND_GRID_API_KEY</APIKey>
        <Sender>load@mydomain.com</Sender>
        <StaticRecipients name="0">firstemail@mydomain.com</StaticRecipients>
        <StaticRecipients name="1">anotheremail@anotherdomain.com</StaticRecipients>
        <StaticRecipients name="2">andanotheremail@foo.com</StaticRecipients>
      </SendGrid>
    </Notifiers>
  </Notify>
</truxton_options>

Slack

Sends notifications to a Slack instance. You will need to setup a webhook to enable his notifier.

Configurations for this notifier are nested in an "Slack" block.

Name Data Type Description
WebhookURL string The webhook url you configured for your microsoft teams instance.
Channel string The channel to post to. Optional. The webhook configured typically has a channel associated to it, but this override that.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <Slack>
        <WebhookURL>https://hooks.slack.com/services/FOO/BAR/FIZZBUZZ</WebhookURL>
        <Channel>OPTIONAL_CHANNEL_NAME</Channel>
      </Slack>
    </Notifiers>
  </Notify>
</truxton_options>

Twilio SMS

Sends SMS notifications via a Twilio account. You will need to setup a Twilio account to enable this notifier.

Configurations for this notifier are nested in an "TwilioSMS" block.

Name Data Type Description
AccountSID string A Twilio Account SID.
AuthToken string A Twilio Authentication Token.
SenderNumber string A Twilio phone number.
StaticRecipients string[] A list of phones numbers who will receive the SMS.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Notifiers>
      <SendGrid>
        <AccountSID>TWILIO_ACCOUNTSID</AccountSID>
        <AuthToken>TWILIO_AUTHTOKEN</AuthToken>
        <SenderNumber>15558675309</SenderNumber>
        <StaticRecipients name="0">5555555555</StaticRecipients>
        <StaticRecipients name="1">5551234567</StaticRecipients>
      </SendGrid>
    </Notifiers>
  </Notify>
</truxton_options>

Topics

The information which is sent through a notifier. Configurations for each Topic is nested in a "Topics" block. Most topics DO NOT need to have configurations unless you plan on omitting certain topics across different notifiers - like if you didn't want the Alert topic to get sent via TwilioSMS. This means each topic is "opt-out". If you have no extra configuration for topics you can safely omit all "Topics" configurations.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Topics>
      <!-- 
          individual topic configs here 
        -->
    </Topics>
  </Notify>
</truxton_options>

The Notify ETL contains the following topics out of the box:

Alert

This topic contains relevant information about any triggered alerts on a media if applicable. If the media did not trigger an alert, this topic will not be sent.

Configurations for this topic are nested in an "Alert" block.

Name Data Type Description
DisabledNotifiers string[] A list notifiers which will NOT send this topic. The name of the notifier should name the configuration block name mentioned for each individual notifier. Optional.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Topics>
      <Alert>
        <DisabledNotifiers name="0">Email</DisabledNotifiers>
        <DisabledNotifiers name="1">SendGrid</DisabledNotifiers>
      </Alert>
    </Topics>
  </Notify>
</truxton_options>

Analyst Load Info

This topic contains relevant information about a completed load from the role of an analyst

Configurations for this topic are nested in an "AnalystLoadInfo" block.

Name Data Type Description
DisabledNotifiers string[] A list notifiers which will NOT send this topic. The name of the notifier should name the configuration block name mentioned for each individual notifier. Optional.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Topics>
      <AnalystLoadInfo>
        <DisabledNotifiers name="0">TwilioSMS</DisabledNotifiers>
        <DisabledNotifiers name="1">Slack</DisabledNotifiers>
      </AnalystLoadInfo>
    </Topics>
  </Notify>
</truxton_options>

Loader Load Info

This topic contains relevant information about a completed load from the role of an data loader. It tends to be more technical in nature.

Configurations for this topic are nested in an "LoaderLoadInfo" block.

Name Data Type Description
DisabledNotifiers string[] A list notifiers which will NOT send this topic. The name of the notifier should name the configuration block name mentioned for each individual notifier. Optional.

E.G. for TruxtonSettings.xml

<truxton_options>
  <!-- ...
       other configs
       ...
    -->
  <Notify>  
    <Topics>
      <LoaderLoadInfo>
        <DisabledNotifiers name="0">TwilioSMS</DisabledNotifiers>
        <DisabledNotifiers name="1">Slack</DisabledNotifiers>
      </LoaderLoadInfo>
    </Topics>
  </Notify>
</truxton_options>

Plugins

Notify supports a plugin architecture to add additional Notifiers and Topics. See the .NET Core SDK articles to how to add a reference to the SDK. The nuget package thats relevant is Truxton.Notifications.Core - this package contains all the necessary transitive SDK dependencies.

Notification SDK

Truxton.Notifications.Core contains several interfaces and relevant classes to allow integration into the Notify ETL.


Plugin Scan Directory

Notify will scan C:\ProgramData\Truxton\Plugins when it starts up for plugins (if the plugin folder does not exist go ahead and create one).

The folder structure for a plugin must be as follows:

  • C:\ProgramData\Truxton\Plugins
    • \PLUGIN_ASSEMBLY_NAME
      • \PLUGIN_ASSEMBLY_NAME.dll
      • (any additional dependencies)

Please take note of the the nested directory. This is so every assembly doesn't need to scanned on startup. So as an example, if my plugin was foobar.dll, you would place it here: C:\ProgramData\Truxton\Plugins\foobar\foobar.dll. Any additional dependencies that foobar.dll needs will go into that directory.