Is there a way NOT to email if a report with no resultCron sending reports weeklyHow NOT to send email to “Activity Assignee” when assigned an activitymail_report format parameterciviCRM Cron only run one mail_report scheduled jobs?How to configure mail_report for every mailing?Can a Scheduled Job using mail_report send Reports as HTML in the e-mail body, rather than as a PDF attached to the e-mail?Send alert if smart group contains any contactsmail Fetch Bounces errorsSome members are not getting scheduled remindersHow to send email report FROM other than default email address?
Should I communicate in my applications that I'm unemployed out of choice rather than because nobody will have me?
"The van's really booking"
Problem in downloading videos using youtube-dl from unsupported sites
How to cope with regret and shame about not fully utilizing opportunities during PhD?
Is Valonqar prophecy unfulfilled?
A case where Bishop for knight isn't a good trade
Is this a group? If so, what group is it?
What information exactly does an instruction cache store?
Why does lemon juice reduce the "fish" odor of sea food — specifically fish?
Why does SSL Labs now consider CBC suites weak?
Should generated documentation be stored in a Git repository?
Help understanding this line - usage of くれる
Can a tourist shoot a gun for recreational purpose in the USA?
Do we have C++20 ranges library in GCC 9?
Uh oh, the propeller fell off
Single word that parallels "Recent" when discussing the near future
Alias for root of a polynomial
Wireless headphones interfere with Wi-Fi signal on laptop
Biology of a Firestarter
Is 12 minutes connection in Bristol Temple Meads long enough?
How to make a not so good looking person more appealing?
Holding rent money for my friend which amounts to over $10k?
Why does the headset man not get on the tractor?
Why didn't the Avengers use this object earlier?
Is there a way NOT to email if a report with no result
Cron sending reports weeklyHow NOT to send email to “Activity Assignee” when assigned an activitymail_report format parameterciviCRM Cron only run one mail_report scheduled jobs?How to configure mail_report for every mailing?Can a Scheduled Job using mail_report send Reports as HTML in the e-mail body, rather than as a PDF attached to the e-mail?Send alert if smart group contains any contactsmail Fetch Bounces errorsSome members are not getting scheduled remindersHow to send email report FROM other than default email address?
I need to email a report weekly to a department within organisation. Report usually sent via scheduled job in Pdf format.
If there's no result an email still gets sent. Is there way NOT to email an empty PDF? thanks
email civireport pdf scheduled-job
add a comment |
I need to email a report weekly to a department within organisation. Report usually sent via scheduled job in Pdf format.
If there's no result an email still gets sent. Is there way NOT to email an empty PDF? thanks
email civireport pdf scheduled-job
add a comment |
I need to email a report weekly to a department within organisation. Report usually sent via scheduled job in Pdf format.
If there's no result an email still gets sent. Is there way NOT to email an empty PDF? thanks
email civireport pdf scheduled-job
I need to email a report weekly to a department within organisation. Report usually sent via scheduled job in Pdf format.
If there's no result an email still gets sent. Is there way NOT to email an empty PDF? thanks
email civireport pdf scheduled-job
email civireport pdf scheduled-job
asked May 9 at 13:56
TapashTapash
1,096511
1,096511
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.
However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.
HTH
Pradeep
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
add a comment |
If it were CSV you could use hook_civicrm_alterMailParams and just check the attachment and if it has 0 rows then set $params['abortMailSend'] = TRUE; to stop it sending.
For PDF I guess you could do the same thing, but do an api call to ReportTemplate.getrows (see api/v3/examples/ReportTemplate/Getrows.php, or the api explorer at /civicrm/api) and if it has 0 rows then abort as above.
Thanks! @Demerit
– Tapash
May 9 at 17:27
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "605"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcivicrm.stackexchange.com%2fquestions%2f30576%2fis-there-a-way-not-to-email-if-a-report-with-no-result%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.
However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.
HTH
Pradeep
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
add a comment |
As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.
However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.
HTH
Pradeep
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
add a comment |
As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.
However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.
HTH
Pradeep
As suggested by Demerit you can use alterMailParams to abort the email if the report has 0 rows. It will work on simple use case but would be difficult or need to add more logic you passing any additional parameters when running cron job or through url to filter the result since the ReportTemplate.getrows api will return the results which is saved in the database but not on fly.
However you can using hook_civicrm_alterReportVar and set $this->_sendmail to FALSE when $rows are empty.
HTH
Pradeep
answered May 9 at 17:04
Pradeep NayakPradeep Nayak
12.7k1624
12.7k1624
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
add a comment |
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
Thanks @pradeep
– Tapash
May 9 at 17:28
Thanks @pradeep
– Tapash
May 9 at 17:28
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
Oh cool. Never knew about that.
– Demerit
May 9 at 18:12
add a comment |
If it were CSV you could use hook_civicrm_alterMailParams and just check the attachment and if it has 0 rows then set $params['abortMailSend'] = TRUE; to stop it sending.
For PDF I guess you could do the same thing, but do an api call to ReportTemplate.getrows (see api/v3/examples/ReportTemplate/Getrows.php, or the api explorer at /civicrm/api) and if it has 0 rows then abort as above.
Thanks! @Demerit
– Tapash
May 9 at 17:27
add a comment |
If it were CSV you could use hook_civicrm_alterMailParams and just check the attachment and if it has 0 rows then set $params['abortMailSend'] = TRUE; to stop it sending.
For PDF I guess you could do the same thing, but do an api call to ReportTemplate.getrows (see api/v3/examples/ReportTemplate/Getrows.php, or the api explorer at /civicrm/api) and if it has 0 rows then abort as above.
Thanks! @Demerit
– Tapash
May 9 at 17:27
add a comment |
If it were CSV you could use hook_civicrm_alterMailParams and just check the attachment and if it has 0 rows then set $params['abortMailSend'] = TRUE; to stop it sending.
For PDF I guess you could do the same thing, but do an api call to ReportTemplate.getrows (see api/v3/examples/ReportTemplate/Getrows.php, or the api explorer at /civicrm/api) and if it has 0 rows then abort as above.
If it were CSV you could use hook_civicrm_alterMailParams and just check the attachment and if it has 0 rows then set $params['abortMailSend'] = TRUE; to stop it sending.
For PDF I guess you could do the same thing, but do an api call to ReportTemplate.getrows (see api/v3/examples/ReportTemplate/Getrows.php, or the api explorer at /civicrm/api) and if it has 0 rows then abort as above.
answered May 9 at 16:40
DemeritDemerit
4,5812622
4,5812622
Thanks! @Demerit
– Tapash
May 9 at 17:27
add a comment |
Thanks! @Demerit
– Tapash
May 9 at 17:27
Thanks! @Demerit
– Tapash
May 9 at 17:27
Thanks! @Demerit
– Tapash
May 9 at 17:27
add a comment |
Thanks for contributing an answer to CiviCRM Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcivicrm.stackexchange.com%2fquestions%2f30576%2fis-there-a-way-not-to-email-if-a-report-with-no-result%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown