0

Dynamically pass email id in Data alert

Hi All,

I am trying to create a stock out data alert to our stores and the alert should be sent to individual store mangers. when ever an item goes out of stock an alert should get triggered and should send a report of the item that are OOS. It should dynamically pick the store manager email _id from table and send out alerts which items specific to that store. Anyone able to parameterize data alerts to accomplish this?

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • This will be an enhancement request so please log a ticket . For now I think it should be possible to write a a python script which can query incorta and then send these alert emails .

    Like
  • Sandeep,

    Here is a site that gives some direction on emailing alerts within python for the interim.  Will also iterate Amit's comment about submitting a ticket for an enhancement request.  Let me know us know if you have further questions.

    Like
  • Hi Amit Kothari Jacob Dockendorf

    Thank you i will submit an enhancement request for this. Also, will look at python script option.

    Like
    • sandeep vittalam  This is a sample code on how to query incorta via external python script using the psycopg2 module (postgres) so you can install that and try.

      import psycopg2
      import smtplib
      
      def get_data():
          """ query data from the  table """
          conn = None
          try:
              conn = psycopg2.connect(host="<host>",port="5436",database="<tenant>",user="admin",password="<passowrd>")
              cur = conn.cursor()
              cur.execute("SELECT vendor_id, vendor_name FROM EBS_PARTY_COMMON.AP_SUPPLIERS ORDER BY vendor_name")
              print("The number of rows: ", cur.rowcount)
              row = cur.fetchone()
      
              while row is not None:
                  print(row)
                  row = cur.fetchone()
      
              cur.close()
          except (Exception, psycopg2.DatabaseError) as error:
              print(error)
          finally:
              if conn is not None:
                  conn.close()
      
      get_data()    
      Like
Like Follow
  • 5 mths agoLast active
  • 4Replies
  • 40Views
  • 3 Following

Product Announcement

Incorta 5 is now Generally Available