Scheduling mail from logstash

Hi this might be silly but I want to know that can i schedule mail from logstash using email-plugin as i want to schedule mail which contains error message from the logs .i had successfully implemented to mail error logs.but it sends mail for each error message .so is there any way ?. if yes how to implement it. As I'm not able to find any reference on internet. So if any one finds it or has solution ,please forward me. and here is my implementation:

input {
    tcp {
        port => 5044
        codec => json
    }
}

output {
    elasticsearch {
        hosts => ["http://elasticsearch:9200"]
        index => "%{[Properties][TrackWizzEnvironment]}-%{[Properties][ServiceName]}-%{+YYYY.MM.dd}" # Dynamic index based on fields
    }
    stdout { codec => rubydebug } # For debugging

    if [Level] == "Error" {
        email {
            to => "xyz@domain.com"
            from => "abc1234@domain.com"
            subject => "🚨 Error Logs Detected!"
            body => "We detected an error log in the last 15 minutes:%{MessageTemplate}"
            address => "136.243.205.196"
            port => 587
            authentication => "plain"
            username => "xyz@domain.com"
            password => "xfgfxg@#th^$xcgv651"
            use_tls => true
        }
    }
}

You might be able to use a metrics filter with flush_interval set to a large number, then use a conditional in the output section to route the metrics to an email output. If you really need the errors in the email then route the metric events through an elasticsearch filter to look them up.

thanks For reply @Badger . But i found alternative for this purpose i.e by using elastAlert2 . but As soon as i get time i will try this solution