# New Action Plugin: KanboardEmailHistory

**URL:** <https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417>\
**Category:** Plugins\
**Created:** [October 22, 2022, 7:20pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417 "2022-10-22T19:20:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [October 22, 2022, 7:20pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/1 "2022-10-22T19:20:48Z")

</div>

A new plugin was finally created to resolve the issues of task histories for remote users.

> [@Send email of a task with comments](https://kanboard.discourse.group/t/send-email-of-a-task-with-comments/108):
>
> Hi folks! There is a way to send email of a finished task including all comments on that task?

Thanks to @creecros for the main part of explaining the code breakdown and the core functionality of this plugin.

> **[GitHub - aljawaid/KanboardEmailHistory: This plugin adds a new Automatic...](https://github.com/aljawaid/KanboardEmailHistory)**
>
> This plugin adds a new Automatic Action to provide any user or department to receive a final email report when a task is closed. Automatic emails are sent detailing the task description including t...

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [November 11, 2022, 6:42pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/2 "2022-11-11T18:42:14Z")

</div>

just a thought of a potential issue… need feedback…

Currently, an email is sent to the task creator or assignee… thats not ALWAYS me… so whats the best way to get this plugin to send me (or another user/email) the end result of this plugin functions?

There is a project identifier and project email field in Kanboard but it’s not clear or mentioned anywhere how to use the fields.

---

<div class="post-metadata">

**Author:** ![alfredb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/alfredb/32/1051_2.png) [@alfredb](https://kanboard.discourse.group/u/alfredb)\
**Post date:** [November 11, 2022, 7:10pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/3 "2022-11-11T19:10:50Z")

</div>

These fields are optional properties of the project, can be used for anything.  
But as a first step, you have to enforce e-mail addresses for your users.

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [November 11, 2022, 7:13pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/4 "2022-11-11T19:13:32Z")

</div>

yeah all my users have email addresses… and I assume the project email address is there for plugins I guess but how do we call it in a template/action?

I think the project email might solve my problem of when an automatic action like this one does something, do it but also send a copy to the project email address.

---

<div class="post-metadata">

**Author:** ![alfredb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/alfredb/32/1051_2.png) [@alfredb](https://kanboard.discourse.group/u/alfredb)\
**Post date:** [November 11, 2022, 7:31pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/5 "2022-11-11T19:31:40Z")

</div>

Get the project by some controller, then can extract the recipient address.  
Or do I miss something?

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [November 15, 2022, 8:54pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/6 "2022-11-15T20:54:52Z")

</div>

models are the gateway to the DB.

`use Kanboard\Model\ProjectModel`

`$project = $this->projectModel->getById($project_id);`

now you can use `$project['email']` to get the email of a project or `$project['identifier']` for identifier

before using them, check that they are set first. `if (isset($project['email']))`

sorry i was on vacation.

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [January 18, 2023, 1:21pm UTC](https://kanboard.discourse.group/t/new-action-plugin-kanboardemailhistory/2417/7 "2023-01-18T13:21:35Z")

</div>

Look out for v2 this week… big thanks to @creecros for making this work

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/f/f4de17dec2aa2c8a09e7324e5cd40df33acd5ec6.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/f/fedeb28146ebf8ca96361388973ca7dc110d023c.png)
