# Richer email notifications

**URL:** <https://community.vikunja.io/t/richer-email-notifications/1891>\
**Category:** Feature Discussion\
**Created:** [9 January 2024 08:48 UTC](https://community.vikunja.io/t/richer-email-notifications/1891 "2024-01-09T08:48:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinbroderick](https://community.vikunja.io/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@colinbroderick](https://community.vikunja.io/u/colinbroderick)\
**Post date:** [9 January 2024 08:48 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/1 "2024-01-09T08:48:15Z")

</div>

As far as I can tell the set of events that will trigger an email notification is quite limited. Currently seems to be only:

- New user sign up.
- Task reminders.
- Task overdue.

When working with teams I think the following are also very important.

- Task assigned to user.
- Comment on task to which user is assigned.
- Material changes to task to which user is assigned (for example, change of due date).

By the way, there also seems to be no (visible) record of who created a task. When managing teams it is generally quite helpful to know who created a task. This person should also be notified if and when a task is updated.

---

<div class="post-metadata">

**Author:** ![colinbroderick](https://community.vikunja.io/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@colinbroderick](https://community.vikunja.io/u/colinbroderick)\
**Post date:** [9 January 2024 09:21 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/2 "2024-01-09T09:21:47Z")

</div>

I had a look at the API source, most recent commit. I’m not a go expert but it looks like `ToMail()` is implemented on `TaskAssignedNotification` and `.Notify()` is called when a task is assigned. So perhaps I’ve misunderstood and notifications are supposed to be sent after all.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [9 January 2024 13:25 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/3 "2024-01-09T13:25:19Z")

</div>

Generally, what you’re describing should work when you subscribe to a project or task. The user who created the task is shown in the bottom-right corner, with the creation date.

---

<div class="post-metadata">

**Author:** ![colinbroderick](https://community.vikunja.io/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@colinbroderick](https://community.vikunja.io/u/colinbroderick)\
**Post date:** [9 January 2024 13:43 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/4 "2024-01-09T13:43:04Z")

</div>

Thanks, I see the creator now.

Still no emails when assigning or subscribing to tasks though. No logged errors that explicitly mention email, but I am seeing an error of the following form when assignments are made.

```auto
2024-01-09T13:36:19.209249192Z: ERROR > models/Handle 125b Event payload does not contain task ID

```

Could that be related? No mention of assigment in the error itself but it is next to mentions of `something/assignees`:

 ![image](https://community.vikunja.io/uploads/default/original/2X/0/0be257627ae4e37a55465cc844df0bce7c6138c3.png)

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [15 January 2024 11:54 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/5 "2024-01-15T11:54:11Z")

</div>

It all looks like a bug. I’ll take a closer look.

> [@colinbroderick](#):
>
> Could that be related?

That looks like an error message related to webhooks.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [28 January 2024 12:16 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/6 "2024-01-28T12:16:42Z")

</div>

It looks like this was a race condition where the assignee would be subscribed to the task (due to the assignment) but the notification to subscribers would be sent before that. This is now fixed in [e4fec01d52](https://kolaente.dev/vikunja/api/commit/e4fec01d524f8b9687370cadd5751151c7bfc48a). Please check the next unstable api build (~45min) to verify if this is still a problem.

---

<div class="post-metadata">

**Author:** ![colinbroderick](https://community.vikunja.io/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@colinbroderick](https://community.vikunja.io/u/colinbroderick)\
**Post date:** [29 January 2024 09:36 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/7 "2024-01-29T09:36:31Z")

</div>

I’m deployed using a docker-compose with the :latest tag on api and frontend. Looks like it’s still happening for now, but will keep an eye on it. I assume that commit won’t have made it in yet?

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [29 January 2024 10:07 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/8 "2024-01-29T10:07:13Z")

</div>

The commit should be in there.

Which version are you running? (From the “info” popup in user menu in the frontend)

---

<div class="post-metadata">

**Author:** ![colinbroderick](https://community.vikunja.io/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@colinbroderick](https://community.vikunja.io/u/colinbroderick)\
**Post date:** [29 January 2024 12:48 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/9 "2024-01-29T12:48:01Z")

</div>

Apologies, looks like the original issue is fixed. Users do now receive emails when tasks are assigned.

There is still some kind of message handling error but doesn’t seem to affect emails.

```auto
vikunja-api-1 | 2024-01-29T12:43:01.295383114Z: ERROR ▶ events/func1 4b9e Error while handling message 39f402f6-94d4-479f-af73-2930ca7cc29c, reason_poisoned=Error 1146 (42S02): Table 'vikunja.webhooks' doesn't exist, topic_poisoned=task.assignee.created, handler_poisoned=task.assignee.created.webhook.listener, subscriber_poisoned=gochannel.GoChannel, payload={"task":{"id":161,"title":"Another test task","description":"","done":false,"done_at":"0001-01-01T00:00:00Z","due_date":"0001-01-01T00:00:00Z","reminders":null,"project_id":2,"repeat_after":0,"repeat_mode":0,"priority":0,"start_date":"0001-01-01T00:00:00Z","end_date":"0001-01-01T00:00:00Z","assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"","index":13,"related_tasks":null,"attachments":null,"cover_image_attachment_id":0,"is_favorite":false,"created":"2024-01-29T12:42:51Z","updated":"2024-01-29T12:42:51Z","bucket_id":2,"position":4096,"kanban_position":851968,"created_by":null},"assignee":{"id":6,"name":"","username":"fakename1","created":"2024-01-11T12:47:51Z","updated":"2024-01-11T12:48:38Z"},"doer":{"id":1,"name":"","username":"fakename2","email":"fakeemail2","created":"0001-01-01T00:00:00Z","updated":"0001-01-01T00:00:00Z"}}
vikunja-api-1 | 2024-01-29T12:43:01.45073485Z: ERROR ▶ events/func1 4ba8 Error while handling message a2a61989-0ce3-4110-b6f6-61c5e6dd69e8, reason_poisoned=Error 1146 (42S02): Table 'vikunja.webhooks' doesn't exist, topic_poisoned=task.updated, handler_poisoned=task.updated.webhook.listener, subscriber_poisoned=gochannel.GoChannel, payload={"task":{"id":161,"title":"Another test task","description":"\u003cp\u003e\u003c/p\u003e","done":false,"done_at":"0001-01-01T00:00:00Z","due_date":"0001-01-01T00:00:00Z","reminders":null,"project_id":2,"repeat_after":0,"repeat_mode":0,"priority":0,"start_date":"0001-01-01T00:00:00Z","end_date":"0001-01-01T00:00:00Z","assignees":[{"id":6,"name":"fakename1","username":"fakename1l","created":"2024-01-11T12:47:51Z","updated":"2024-01-11T12:48:38Z"}],"labels":null,"hex_color":"","percent_done":0,"identifier":"#13","index":13,"related_tasks":{},"attachments":null,"cover_image_attachment_id":0,"is_favorite":false,"created":"2024-01-29T12:42:51Z","updated":"2024-01-29T12:42:58Z","bucket_id":2,"position":4096,"kanban_position":851968,"created_by":{"id":1,"name":"","username":"fakename2","created":"2024-01-08T13:57:23Z","updated":"2024-01-09T09:31:03Z"}},"doer":{"id":1,"name":"","username":"fakename2","email":"fakeemail2","created":"0001-01-01T00:00:00Z","updated":"0001-01-01T00:00:00Z"}}

```

---

<div class="post-metadata">

**Author:** ![nmnj](https://community.vikunja.io/user_avatar/community.vikunja.io/nmnj/32/1646_2.png) [@nmnj](https://community.vikunja.io/u/nmnj)\
**Post date:** [27 September 2024 10:12 UTC](https://community.vikunja.io/t/richer-email-notifications/1891/10 "2024-09-27T10:12:02Z")

</div>

> [@colinbroderick](#):
>
> Task overdue.

In my case, in daily report email, we’d rather have email notifications about tasks that are due in next 24 hours than getting the report with the list of tasks for which the due date was missed.
