1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Looking for a way to keep Kayako from sending me an email when a scheduled report contains no data

Discussion in 'Developing, APIs and extending' started by Dan Coistek, Jan 21, 2016.

  1. Dan Coistek

    Dan Coistek Member

    Hi Everyone,

    Love that I have the ability to schedule reports in Kayako and have them emailed to me. The problem is that over the course of almost two years, I find myself having 20+ reports that run daily to assist me with maintaining the integrity of our data and overall health of our help desk.

    I know there is no setting in Kayako to tell it not to send me an email when there are no results from a report but does anyone happen to know if files can be modified in order to change this behavior? In the end I want emails to be generated if there is data returned for a report and if not, just don't send the email.

    Any help is appreciated.

    Thanks,

    Dan
     
  2. Sukhpreet Kaur

    Sukhpreet Kaur Staff Member

    Hello Dan,

    You can use {if} statement to keep a check on attachment content while helpdesk sends the email for scheduled report. What you can do is, you can make the modifications in the code file __apps/reports/models/Schedule/class.SWIFT_ReportSchedule.php

    Look out for the function: public function Execute() ; and add {if} condition to check if the attachment contains the data or not, and then call upon the SendMail() object.

    I hope this will help to achieve your requirements.

    Sukhpreet Anand
     
  3. Dan Coistek

    Dan Coistek Member

    Thank you. I got a chance to look at this and it worked perfectly. For anyone interested:

    __apps/reports/models/Schedule/class.SWIFT_ReportSchedule.php

    On Line 341 cut the following code:

    $_SWIFT_MailObject->SendMail();

    In the if statement right above, about line 336, paste it back in. You If statement will now look like this:

    if (empty($_errorMessage)) {

    $_SWIFT_MailObject->Attach($_fileContainer['content'], $_fileContainer['mime-type'], $_fileContainer['filename']);

    $_SWIFT_MailObject->SendMail();

    }

    Now you not receive an email if there are no attachments.


    Thanks for your help Sukhpreet.

    Dan
     
  4. Oisin McGillicuddy

    Oisin McGillicuddy New Member

    @Sukhpreet, is there a solution to this problem on a hosted Kayako solution?
     

Share This Page