Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
AsmJuv2004
Contributor II
Contributor II

Get the recipient list of Nprinting publish tasks

Hi All,

I need to get the list of all recipient users (Users present in To section and also cc/bcc section of mail) for all publish tasks.

I searched around and found two ways mentioned in net, one to use API and another to connect to postgreSQL repository database mentioned here (https://community.qlik.com/t5/Qlik-NPrinting/Overview-Users-per-task-in-NPrinting/td-p/1704918)

I tried the second approach and queried the "public"."publish_report_task_recipient" table which contains recipient details. But I see most tasks only have the recipients under TO section in the mail. They dont have recipients in the CC/BCC section in the mail.

 

Please let me know if there is any other way or if I'm doing something wrong.

Labels (2)
1 Reply
TheLazyDeveloper

These tables should get the info you need with these two field smtp_destination_id  and email:
public"."smtp_destination_to_to"
"public"."smtp_destination_to_cc"
"public"."smtp_destination_to_bcc"

You can join these to "public"."destination" table with the id field which will also list the TaskIDs in the publish_report_task_id field. 

EX:

Task:
    Load
  id as TaskID,
  name as TaskName
  ;
    SQL SELECT 
id, //Task ID
    name // Task Name
FROM "NP"."public"."task";  
    
    
    
  Recipients:
  Load
  id as Destination_ID,
  publish_report_task_id as TaskID
  ;
  SQL SELECT 
id, //match to destination_id
    publish_report_task_id //TaskId from NP
FROM "NP"."public"."destination";  

Left Join(Recipients)
    Load
  smtp_destination_id as Destination_ID,
  email as Recipient,
    'To' as Source
  ;
SQL SELECT 
smtp_destination_id,
email
FROM "NP"."public"."smtp_destination_to_to";

You will still need to use "public"."publish_report_task_recipient"  table as well since it holds users that were added under destinations in tasks if I remember correctly.