# Notification emails are generated before triggering action is completed

**URL:** <https://www.dolibarr.org/forum/t/notification-emails-are-generated-before-triggering-action-is-completed/24229>\
**Category:** Other native modules\
**Tags:** Notifications\
**Created:** [August 30, 2023, 3:14pm UTC](https://www.dolibarr.org/forum/t/notification-emails-are-generated-before-triggering-action-is-completed/24229 "2023-08-30T15:14:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacotec](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/97f17d/32.png) [@Jacotec](https://www.dolibarr.org/forum/u/Jacotec)\
**Post date:** [August 30, 2023, 3:14pm UTC](https://www.dolibarr.org/forum/t/notification-emails-are-generated-before-triggering-action-is-completed/24229/1 "2023-08-30T15:14:08Z")

</div>

Hi,

I’m new to Dolibarr and switched from ERPNext. I’m more than happy to have a platform now which is easy to understand and operate 🙂

I’m thrilled by the ability to automatically send invoices to customers via the notification feature. Unfortunately the “processing hook” of the module seems to be too early:

- When an invoice is validated, the checkbox “append file” in the email template does nothing. The notification seems to be generated before the final invoice is completely generated.

- The Reference still gives back the “PROV” number, not the final invoice number

- When a notification is triggered by a completed payment, the attached document is still the original, old invoice - not the new version with the payment remark.

- When a subscription triggers an automatic validated invoice, there is also no document attached. In this case, even the public download link placeholder is empty - so in this case no invoice at all can be sent to the customer automatically.

As a conclusion: The notification should be processed after all the things which had triggered the notification are completely processed. Or the notification should be in general delayed by a few seconds, so it can be assured that all the needed processes are completed before the notification is generated.

Has anyone an idea how this can be done?

Edit: I’ve created a GitHub issue: [Notifications are generated before the triggering process is completed · Issue #25738 · Dolibarr/dolibarr · GitHub](https://github.com/Dolibarr/dolibarr/issues/25738)
