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?













2















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










share|improve this question


























    2















    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










    share|improve this question
























      2












      2








      2








      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 9 at 13:56









      TapashTapash

      1,096511




      1,096511




















          2 Answers
          2






          active

          oldest

          votes


















          2














          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






          share|improve this answer























          • Thanks @pradeep

            – Tapash
            May 9 at 17:28











          • Oh cool. Never knew about that.

            – Demerit
            May 9 at 18:12


















          1














          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.






          share|improve this answer























          • Thanks! @Demerit

            – Tapash
            May 9 at 17:27











          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
          );



          );













          draft saved

          draft discarded


















          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









          2














          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






          share|improve this answer























          • Thanks @pradeep

            – Tapash
            May 9 at 17:28











          • Oh cool. Never knew about that.

            – Demerit
            May 9 at 18:12















          2














          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






          share|improve this answer























          • Thanks @pradeep

            – Tapash
            May 9 at 17:28











          • Oh cool. Never knew about that.

            – Demerit
            May 9 at 18:12













          2












          2








          2







          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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











          1














          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.






          share|improve this answer























          • Thanks! @Demerit

            – Tapash
            May 9 at 17:27















          1














          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.






          share|improve this answer























          • Thanks! @Demerit

            – Tapash
            May 9 at 17:27













          1












          1








          1







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 9 at 16:40









          DemeritDemerit

          4,5812622




          4,5812622












          • Thanks! @Demerit

            – Tapash
            May 9 at 17:27

















          • Thanks! @Demerit

            – Tapash
            May 9 at 17:27
















          Thanks! @Demerit

          – Tapash
          May 9 at 17:27





          Thanks! @Demerit

          – Tapash
          May 9 at 17:27

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림