3 Replies Latest reply on Aug 9, 2018 3:45 AM by Naveen B

    Sending mail to multiple user as per filter condition

    Milan Das

      Hi Guys,Need your help on this.

       

      The below is my scenario.

       

      In my dashboard there is filter condition of User email ID  on that PDF file will be generate for all the user (30K user) and have to send email to individual user to there email id . How i can write tabcmd script to automate this process.

       

      client name is filter condition as per user selection the dashboard will change .Then we have to generate PDF of that dashboard and mail to that particular user.

       

      There are almost 30,000 user . I have this tabcmd script but this is for static report .

      cd D:\Users\extras\Command Line Utility

       

       

      tabcmd.exe" login -s http://server.com/ -u username -p pwd --no-certcheck

      tabcmd export "C:/Milan.pdf" --fullpdf --no-certcheck

      tabcmd get "********" -f "D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU.pdf" --no-certcheck

      powershell.exe Send-MailMessage

      -TO "milan*****"----user email id

      -Subject "Subject" 

      -FROM "Tableau"

      -smtpserver  smtp.ap.jnj.com

      -Attachments 'D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU/milan.pdf'

      tabcmd logout

       

      2

       

      tabcmd.exe" login -s http://server.com/ -u username -p pwd --no-certcheck

      tabcmd export "C:/Das.pdf" --fullpdf --no-certcheck

      tabcmd get "********" -f "D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU.pdf" --no-certcheck

      powershell.exe Send-MailMessage

      -TO "Das*****"----user email id

      -Subject "Subject" 

      -FROM "Tableau"

      -smtpserver  smtp.ap.jnj.com

      -Attachments 'D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU/milan.pdf'

      tabcmd logout

       

      Please suggest how i can automate the mail sending with respect to filter condition selection.

        • 1. Re: Sending mail to multiple user as per filter condition
          Naveen B

          Hi Milan,

           

          1) Connect to your DB from Power Shell to get the user email List and store it in a variable called @emailid

          2) follow the script like this

           

          tabcmd.exe" login -s http://server.com/ -u username -p pwd --no-certcheck

           

          for .. loop

          (

          tabcmd get "********?<dashboard Field Name>=@emailID" -f "D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU\@emailid.pdf" --no-certcheck

          powershell.exe Send-MailMessage

          -TO "@emaillid ----user email id

          -Subject "Subject"

          -FROM "Tableau"

          -smtpserver  smtp.ap.jnj.com

          -Attachments 'D:\Users\extras\Command Line Utility\Daily Sales Report Ortho AU\@emailid.pdf'

          tabcmd logout

           

          )

           

          this will helps mark this answer as correct/helpful so that it will help others

           

           

          BR,

          NB

          2 of 2 people found this helpful
          • 2. Re: Sending mail to multiple user as per filter condition
            Milan Das

            Connect to your DB from Power Shell to get the user email List and store it in a variable called @emailid

             

            How we can do it from tableau server ? So data base is Salesforce?

            • 3. Re: Sending mail to multiple user as per filter condition
              Naveen B

              Hi Milan,

               

              1) Ask the Sales force team extract the email users list and store them in text file

              2) then use the power shell to read the file line by line , and pass the value in the for loop

               

              i think you can do this there is something which already developed using another sales report

               

              you can check with sales force team to provide text file in regular intervals

               

              mark this answer as correct/helpful so that it will help others

               

              BR,

              NB