CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • emailing Reports
Pages: [1]

Author Topic: emailing Reports  (Read 984 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
emailing Reports
July 25, 2011, 03:58:59 pm
 Hi,

 I have a requirement to send a civireport of branch members to each of 90 branches each month (we use a custom field to denote the branch). Am I right in thinking I need 90 reports & 90 specific cron entries to do this 'out-of-the-box'

Or,  can  I script a much more 'nuanced' cron & pass report parameters in. My quick look at CiviReportMail.php suggests I can't pass in email address or filters - which is what I would need for this approach.

I haven't really gone down the track of setting up reports to email in the past because the one cron per report has never seemed to fit (i.e I'd want to be able to set up the cron & then the users of the site could set up individual reports as they required them)

As a side issue - one frustration I have with working with reports through the gui is that I can edit an existing report & update it but I can't edit it and 'save as new;

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: emailing Reports
July 26, 2011, 12:43:55 am
Quote
I have a requirement to send a civireport of branch members to each of 90 branches each month (we use a custom field to denote the branch). Am I right in thinking I need 90 reports & 90 specific cron entries to do this 'out-of-the-box'

Yes, if the criteria is different for all the reports.

If its a single / same report you want to mail to 90 branches, you could still do using alterMailParams hook with one entry in the cron.

When the criteria is slightly different, one trick i can think of that i never experimented is - if the criteria could be specified in the url as filter, u would need 90 cron entries (with criteria specified), but 1 report plus the alterMailParams hook implemented.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: emailing Reports
July 26, 2011, 02:59:52 am
I got the impression from the code I looked at in the bin folder that it's not grabbing the criteria from the URL but I guess I can try it
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: emailing Reports
July 26, 2011, 03:29:55 am

1. can u file an issue for "save and new". should be a fairly easy feature add

2. might want to write a wrapper script, which manipulates the instance data and sets it to a different value for each of the 90 regions and then triggers an email. I suspect u want each report to be mailed to a different person, so that would need to be in some table somewhere. In general would be great if we can figure out how to tokenize things like report instances and smart groups

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: emailing Reports
July 26, 2011, 03:45:16 am
Logged http://issues.civicrm.org/jira/browse/CRM-8562

I'm thinking that the criteria for a report may be stored in relationship - e.g. the report for Widgeemootha branch will be sent to the person who has the active branch co-ordinator relationship with Widgeemootha branch. So, yes I will definitely need a wrapper to call the report multiple times.


I'll test & confirm whether the filter can be passed in.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • emailing Reports

This forum was archived on 2017-11-26.