fix: fixed email count for current month (#8452)
This commit is contained in:
parent
7d2e664b74
commit
7ef5b20ca4
1 changed files with 4 additions and 2 deletions
|
|
@ -243,8 +243,10 @@ def get_email_queue(recipients, sender, subject, **kwargs):
|
|||
return e
|
||||
|
||||
def get_emails_sent_this_month():
|
||||
return frappe.db.sql("""SELECT COUNT(`name`) FROM `tabEmail Queue` WHERE
|
||||
`status`='Sent' AND EXTRACT(MONTH FROM `creation`) = EXTRACT(MONTH FROM NOW())""")[0][0]
|
||||
return frappe.db.sql("""
|
||||
SELECT COUNT(*) FROM `tabEmail Queue`
|
||||
WHERE `status`='Sent' AND EXTRACT(YEAR_MONTH FROM `creation`) = EXTRACT(YEAR_MONTH FROM NOW())
|
||||
""")[0][0]
|
||||
|
||||
def get_emails_sent_today():
|
||||
return frappe.db.sql("""SELECT COUNT(`name`) FROM `tabEmail Queue` WHERE
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue