bigfunctions > send_mail_with_excel
send_mail_with_excel¶
Signature
send_mail_with_excel(to, subject, content, excel_filename, table_or_view_or_query)
Description
Sends an email with table_or_view_or_query
data attached as excel file
(only the first 1000 rows will be copied to the excel file)
This function calls
json2excel
andsend_mail
functions.
Param | Possible values |
---|---|
to |
One or multiple comma separated emails. For instance contact@unytics.io or contact@unytics.io, paul.marcombes@unytics.io |
subject |
Email subject |
content |
Can be plain text, html or markdown |
attachment_filename |
filename with extension such as report.xlsx |
table_or_view_or_query |
A fully qualified table or view you have permission to read or a sql query starting with select |
Examples
call bigfunctions.eu.send_mail_with_excel(
'contact@unytics.io',
'Financial Report',
'''
# Monthly Report from BigQuery
## KPIs
- **MRR**: 32,343 USD
- **Churn**: 4.2 %
- **Subscriptions**: +3452
''',
'report.xlsx',
'eu.sales');
call bigfunctions.us.send_mail_with_excel(
'contact@unytics.io',
'Financial Report',
'''
# Monthly Report from BigQuery
## KPIs
- **MRR**: 32,343 USD
- **Churn**: 4.2 %
- **Subscriptions**: +3452
''',
'report.xlsx',
'us.sales');
call bigfunctions.europe_west1.send_mail_with_excel(
'contact@unytics.io',
'Financial Report',
'''
# Monthly Report from BigQuery
## KPIs
- **MRR**: 32,343 USD
- **Churn**: 4.2 %
- **Subscriptions**: +3452
''',
'report.xlsx',
'europe_west1.sales');