Answers.Body: <p>It doesn't exist for search, but it does for reports. Could you use a report instead of the search?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-14T17:21:49.353Z
Answers.Text: That would explain why I was unable to find a solution.
Answers.UserDisplayName: user469
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-14T17:39:33.800Z
Answers.Text: I don't want to maintain a report for each grouping. My thought is to build a smart group with the criteria listing the people who get the reports on a monthly basis. When the template runs the tokens understand who the report is being sent to and craft it based on each individual. We use this process to do our billing.  The new requirement is the need to  run the process on a implement schedule. instead having the office staff remember to run the process. 
  
  I am looking  to find a way for crons to cause the online function to run in the background.
Answers.UserDisplayName: user469
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-15T14:34:44.843Z
Answers.Text: What you describe would be cool, but it'll need some custom coding--both on determining the recipients and figuring out the appropriate settings for the report.  Xavier's right that you should start with a report, though.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-15T19:54:20.423Z
Answers.Text: I need 16 different reports, each report is sent to 2 or 3 people. Setting up and maintaining the distributions for each report is a big job. People move and you need to keep up with the changes. is a big job. My thought is to have a smart group know who gets which version of the report and  the template using tokens generates the correct report and sends it. I agree implementing the function requires work. Is there an existing Civi requirement or do I need to build one.
Answers.UserDisplayName: user469
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-14T15:02:26.750Z
Answers.LastActivityDate: 2015-06-14T15:02:26.750Z
Answers.UserDisplayName: Xavier
Body: <p>I have a number of cases where I need to run a cron job to use a custom search and a template.  It should be simple to schedule a mailing to automatically run on some basis.  </p>
  
  <p>I have 2 current examples, Once a month I need to send a summary to a contact listing the status of their constituents. I have a group listing all the recipients of a report. For each person a  template is called and from the use of tokens generates and sends the report. </p>
  
  <p>In another case I have a search which identifies the payments from the previous day. The cron runs and based on a template sends acknowledgements.</p>
  
  <p>I would think there should be an easy way of setting up a cron which calls a search and a template. Unfortunately I don't see how to easily specify the two parts, If a current module exists where I can just name the search and the template that would solve my problem. This would be like automatically launching a mailing daily from a cron. </p>
  
Tags: <civimail><cron-job>
Title: Setup cron job generate emails
ThreadText: # Setup cron job generate emails
  
  (Asked by: username_0 on 2015-06-14)
  
  I have a number of cases where I need to run a cron job to use a custom search and a template. It should be simple to schedule a mailing to automatically run on some basis.
  
  I have 2 current examples, Once a month I need to send a summary to a contact listing the status of their constituents. I have a group listing all the recipients of a report. For each person a template is called and from the use of tokens generates and sends the report.
  
  In another case I have a search which identifies the payments from the previous day. The cron runs and based on a template sends acknowledgements.
  
  I would think there should be an easy way of setting up a cron which calls a search and a template. Unfortunately I don't see how to easily specify the two parts, If a current module exists where I can just name the search and the template that would solve my problem. This would be like automatically launching a mailing daily from a cron.
  
  **Tags:** civimail, cron-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-14. Score: 1
  
  It doesn't exist for search, but it does for reports. Could you use a report instead of the search?
  
  > **Comments:**
  > **username_0**: That would explain why I was unable to find a solution.  
  > **username_0**: I don't want to maintain a report for each grouping. My thought is to build a smart group with the criteria listing the people who get the reports on a monthly basis. When the template runs the tokens understand who the report is being sent to and craft it based on each individual. We use this process to do our billing.  The new requirement is the need to  run the process on a implement schedule. instead having the office staff remember to run the process.   I am looking  to find a way for crons to cause the online function to run in the background.  
  > **username_2**: What you describe would be cool, but it'll need some custom coding--both on determining the recipients and figuring out the appropriate settings for the report.  username_1's right that you should start with a report, though.  
  > **username_0**: I need 16 different reports, each report is sent to 2 or 3 people. Setting up and maintaining the distributions for each report is a big job. People move and you need to keep up with the changes. is a big job. My thought is to have a smart group know who gets which version of the report and  the template using tokens generates the correct report and sends it. I agree implementing the function requires work. Is there an existing Civi requirement or do I need to build one.  
  
  ---
  
  