3 Replies Latest reply on Jun 30, 2017 4:18 PM by dmoler

    How send a Notification PI AF SDK ?

    JaimeR

      Hi !

       

      I need some help about PI Notification SDK. In my code I want send a E-mail like showing in the Console (line 06,07). The outputs is only the result from a simple comparation between a constant and the Attribute value. How can I send a simple Notification to some E-mail with PI AF SDK?

       

      .
      .
      .
      for (int IndWells = 0; IndWells < countWells; IndWells++)
       {
      Console.WriteLine("\nWell Name:" + WellName[IndWells]);
      Console.WriteLine("%Error:" + ErrorValue[IndWells]);
      
      
       string Output1 = WellName[IndWells];
       double Output2 = ErrorValue[IndWells];
      
        AFNotificationContactTemplate testEmail = piSystem.NotificationContactTemplates["TestEmail"];
                          
                              if (testEmail == null)  
                          {
      
                              testEmail = new AFNotificationContactTemplate(piSystem, "TestEmail");
      testEmail.DeliveryChannelPlugIn = piSystem.DeliveryChannelPlugIns["Email"];
      
                              testEmail.DeliveryChannel.ConfigString = "email@tx.com";
                              
                           }
                          // Add a subscription to a notification.  
                          notificationRule.Subscribers.Add(testEmail); 
      
      
      
      
      
      
      
      
       }