Skip to content

Receipts sent to archive twice when sending core workflow msg

Created by: waddyvic

When CiviCRM core sends receipt email using CRM_Core_BAO_MessageTemplate, this hook was invoked twice:

  • once in CRM_Core_BAO_MessageTemplate::sendTemplate(), context "messageTemplate"
  • once in CRM_Utils_Mail::send(), which is called by CRM_Core_BAO_MessageTemplate::sendTemplate(), context "singleEmail"

Hence, cdntaxreceipts_issueTaxReceipt() is called twice, sending 2 receipts to archive email.

To avoid this, only execute this hook when context is "messageTemplate".

Merge request reports