Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rittermd
Honored Contributor

Using Email Notification Connector

So I got through the first part of setting up the connector and sending a test email. 

Now I want to add to my load script the code needed to shoot off an email to me if the task is not successful. 

I have the sample code that is not specific to any event.  This came from the YouTube video. 

LIB CONNECT TO 'Send Email Alerts';

LET vMsg = 'Sent at ' & Now();

RestConnectorMasterTable:

SQL SELECT

"status",

"result",

"filesattached"

FROM CSV (header on, delimiter ",", quote """") "CSV_source"

WITH CONNECTION(

     QUERY "to" "mritter@dunbararmored.com"

     ,QUERY "cc" "mritter@dunbararmored.com"

     ,QUERY "subject" "$(vMsg)"

     ,QUERY "message" "Yippie"

     ,QUERY "fromName" "noreply"

     ,QUERY "fromEmail" "Qlik@dunbarmored.com"

     ,QUERY "forate" "csv"

     );

[CSV_source]:

LOAD [status] AS [status],

[result] AS [result],

[filesattached] AS [filesattached]

RESIDENT RestConnectorMasterTable;

DROP TABLE RestConnectorMasterTable;

I suspect that I can use the above code but need to put a loop or something in and also check for an error level.  But I am not sure what to do next.

4 Replies
dwforest
Valued Contributor

Re: Using Email Notification Connector

rittermd
Honored Contributor

Re: Using Email Notification Connector

Thanks.  Do you need to do anything other than create the xml file under the service you want to monitor?  Obviously you need to modify the domain and email addresses.  But anything else?

dwforest
Valued Contributor

Re: Using Email Notification Connector

You'd have to make sure you have an SMTP server and appropriate credentials and the smtp port is not blocked, but no other set up in Qlik is needed

rittermd
Honored Contributor

Re: Using Email Notification Connector

I already went through all of the SMTP stuff and that seems to be working.

If I want to be notified anytime a task has an error where do I need to put this xml file?

Community Browser