redash icon indicating copy to clipboard operation
redash copied to clipboard

Scheduled reports by email

Open arikfr opened this issue 12 years ago • 76 comments

arikfr avatar Oct 28 '13 14:10 arikfr

Hi arikfr,

Does the re:dash project support the daily email reports?

thomastanmin93 avatar Jul 10 '15 09:07 thomastanmin93

@Thomasmisfit not at the moment, but it's high on the list of next things to implement.

arikfr avatar Jul 12 '15 20:07 arikfr

:+1:

Any thoughts when this might get on the roadmap again? It'll be a pretty neat feature to have.

vincetse avatar Feb 01 '16 03:02 vincetse

@thelazyenginerd it's on the roadmap, but I can't commit on specific dates for feature releases.

arikfr avatar Feb 07 '16 20:02 arikfr

@arikfr this would be really good feature to have.

ChiragKParmar avatar Apr 29 '16 01:04 ChiragKParmar

@ChiragKParmar I agree :-)

arikfr avatar Apr 30 '16 14:04 arikfr

@arikfr - Would this flow be ideal?

  1. Run a cron to query the DB at said time interval.
  2. Save the query result in a file (Somewhere in /opt/redash folders).
  3. Run a python job to pick up that file , attach it and send email to designated email address

shahneil88 avatar May 17 '16 01:05 shahneil88

@shahneil88 it's possible, but then why use Redash? IMO, a better approach would be to get the query result from Redash via the API, and send it by email.

I even have an example script that does that: https://gist.github.com/arikfr/a730451c01d1dd326412

arikfr avatar May 23 '16 13:05 arikfr

@arikfr has this feature implemented?

alenave avatar Oct 14 '16 10:10 alenave

+1

abeniwal avatar Oct 19 '16 18:10 abeniwal

@alenave it wouldn't be open if it was implemented...

arikfr avatar Oct 20 '16 09:10 arikfr

@arikfr thanks for the script! going to adapt for my org now.

pjatx avatar Dec 22 '16 17:12 pjatx

+1

ultymike avatar Apr 13 '17 19:04 ultymike

+1

rahul-pande avatar Aug 07 '17 17:08 rahul-pande

+1

nickihm avatar Aug 07 '17 17:08 nickihm

+1 a much awaited feature for ReDash

gamefundas avatar Sep 07 '17 14:09 gamefundas

+1

praneeth-sajepa avatar Sep 09 '17 11:09 praneeth-sajepa

+1

foaadnami avatar Sep 13 '17 04:09 foaadnami

+1

arpitset avatar Oct 05 '17 07:10 arpitset

+1

sandeep89 avatar Nov 06 '17 06:11 sandeep89

+1

asafmaor avatar Nov 09 '17 10:11 asafmaor

+1

yoavbls avatar Nov 21 '17 19:11 yoavbls

+1

aanari avatar Nov 22 '17 17:11 aanari

+1

Miggleness avatar Jan 27 '18 01:01 Miggleness

Thanks all. Please do not post +1s: we know this is an open issue. :)

RichardLitt avatar Jan 27 '18 15:01 RichardLitt

@arikfr suggested we use the API to email the report as CSV. That is ok but the killer feature is to email a specific configured dash board with charts, graphs and the raw CSV report data on an interval (nightly or weekly). Sure we can write code to scrape the dashboard HTML and use that as our email body but it isn't as nice

ronin1 avatar Apr 19 '18 19:04 ronin1

+1

OscarBeiro avatar Jun 18 '18 17:06 OscarBeiro

I was able to cobble something together using Zapier that does this. Not ideal but I thought I'd share this workaround for anyone who wants it in the meantime:

Trigger: Schedule (Every Week)

You can get {query id} (a number) and {api key} (a random alphanumeric string) from them embed URL of the query.

Action: WebHooks by Zapier -> GET

URL

https://redash.vaultdrop.com/api/queries/{query id}/results.csv

Query String Params

api_key = ...

Send as JSON

No

Action: Code by Zapier > JavaScript

Code

output = {html: `
<html>
<body>
<table colspacing=0 colpadding=0>
  <thead>
    <tr>
      ${inputData.csv.split('\n')[0].split(',').map(h => `<th style="text-align: right; padding: 2px">${h}</th>`).join('\n    ')}
    </tr>
  </thead>
  <tbody>
      ${inputData.csv.split('\n').splice(1).map(
          (line, n) => `<tr>\n${line.split(',').map(v => `<td style="text-align: right; padding: 2px; background-color:${n&1?'#f2f2f2':'white'}">${v}</td>`).join('\n')}</tr>`).join('\n')}
</tbody>
</table>
</body>
</html>
`
};

Action: Mandrill > Send Email

Put the HTML output into the message body. Other mail sending methods that support HTML will work as well.

dobesv avatar Jun 26 '18 00:06 dobesv

Actually with Zapier you need a paid plan to really use it well for this purpose. I created a serverless AWS project that can be used to run a report and email it on a schedule, since I don't have any other use for Zapier right now:

https://github.com/dobesv/redash-scheduled-email

dobesv avatar Jun 26 '18 21:06 dobesv

Hey guys i managed to send reports of each query in CSV form in mail, Please is there a way to send reports in png screenshots form.

BouchaaraAdil avatar Nov 26 '18 15:11 BouchaaraAdil