Answers.Body: <p>The last time I did this, which was a while ago, I didn't do anything with the job in the admin screens in civi, I just set up a cron job and gave it the parameters there, e.g.</p>
  
  <p><code>php bin/cli.php -u cms_user_name -e Job -a mail_report --instanceId=82 --format=csv</code></p>
  
  <p>So for multiple reports just add more similar lines in your cron script.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-05T22:15:02.593Z
Answers.LastActivityDate: 2020-03-05T22:15:02.593Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>The format is</p>
  
  <pre><code>instanceId=1
  format=csv
  </code></pre>
  
  <p>No brackets. The <code>format</code> parameter value can also be <code>print</code> for printer-friendly HTML. If no format is specified it will send as PDF.</p>
  
  <p>If you are doing this in the UI, you have to setup a separate job for each report. That is useful, because you may want some reports mailing at a different frequency.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-05T23:01:15.130Z
Answers.LastActivityDate: 2020-03-05T23:07:44.687Z
Answers.LastEditDate: 2020-03-05T23:07:44.687Z
Answers.UserDisplayName: Andy Burns
Body: <p>Our cron is setup correctly - however I am not sure our parameters for the job <code>mail_report</code> are. </p>
  
  <p><code>instanceId=[82] format=[print]</code></p>
  
  <p>Also, do I have to create a separate job for each report or can I create one job for all reports? Lets say I just want an HTML print out embedded in the body of the email for all reports in which there is an email  setup.</p>
  
Tags: <reports><scheduled-job>
Title: How do you properly setup scheduled job for report mailings?
ThreadText: # How do you properly setup scheduled job for report mailings?
  
  (Asked by: username_0 on 2020-03-05)
  
  Our cron is setup correctly - however I am not sure our parameters for the job `mail_report` are.
  
  `instanceId=[82] format=[print]`
  
  Also, do I have to create a separate job for each report or can I create one job for all reports? Lets say I just want an HTML print out embedded in the body of the email for all reports in which there is an email setup.
  
  **Tags:** reports, scheduled-job
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-03-05. Score: 3 | Accepted answer
  
  The format is
  
  ```
  instanceId=1
  format=csv
  
  ```
  
  No brackets. The `format` parameter value can also be `print` for printer-friendly HTML. If no format is specified it will send as PDF.
  
  If you are doing this in the UI, you have to setup a separate job for each report. That is useful, because you may want some reports mailing at a different frequency.
  
  
  ---
  
  ### Answer by username_1 on 2020-03-05. Score: 1
  
  The last time I did this, which was a while ago, I didn't do anything with the job in the admin screens in civi, I just set up a cron job and gave it the parameters there, e.g.
  
  `php bin/cli.php -u cms_user_name -e Job -a mail_report --instanceId=82 --format=csv`
  
  So for multiple reports just add more similar lines in your cron script.
  
  
  ---
  
  