Hi folks!
There is a way to send email of a finished task including all comments on that task?
Hi folks!
There is a way to send email of a finished task including all comments on that task?
not out of the box.
you could:
1.) add an automatic action that does it for you
https://docs.kanboard.org/en/latest/plugins/automatic_actions.html
or
2.) override the notification template for the appropriate event (i.e. task close), with your own template to include all the comments.
https://docs.kanboard.org/en/latest/plugins/overrides.html
Hello, did you manage to find a solution for this?
which part cant you figure out?
This action sends and email whenever there is a âNew Commentâ on a task.
I would think it should give you a good baseline to figure out how to send âAll commentsâ when a task is closed.
If you canât figure it out, let me know.
I will look at it again, Im just getting confused with how to create the action to send an email so that when the task closes, besides sending an email to comment that the task is closed⌠another email is fired through actions to send the âsummaryâ of the closed task⌠e.g. description and full comment history.
so do you want 1 email upon task close, with all comments and descriptions, or do you want 2 emails?
I already get an email that a task is closed⌠through an actionâŚ
I need a seperate email with a subject (Task summary) which will consist of the task description with a full history of the comments.
So for this board i would get 2 emails, but for other boards it would depend on which actions i use for that board.
ya that should be pretty simple.
get as far as you can, and then either add me to the repo or send me the code, and i will complete it.
am I right or wrong in saying that the only thing to change (in a duplicate file of course) would be:
$this->template->render('commen/show', array(
'task' => $data['task'],
'comment' => $data['comment'],
))
this wouldÄsend ALL the task comments⌠then to add the description it would be to add 'description' => $data['description'],
to the array?
Or have I got it all wrong?
that would be a negative. you want to send all comments, the current action i wrote, is based on when a new comment is created, i.e. the event. That event only carries the data for that comment, its also not your event, that you want. your event is on task close. TaskModel::EVENT_CLOSE
you need to look at a controller that sends data to âcomment/showâ template, see how they handle that. Probably the TaskViewController, is where that is going to start, and then follow the code until you find exactly what to send to the âcomment/showâ template, and whether or not you need any iterations, may already be handled with the iterations.
you can see here the beginning of the comment data coming to fruition.
it actually sends the data to âtask_comment/showâ next, id follow suit if i were you.
from there it takes care of all the iterations for you.
it might seem complicated, but its actually simple, send the exact same data, to the âtask_comment/showâ template, and then all the comments will be rendered in your email.
the above gives you all the information you need to do that, how to get the data(mostly found in the controller using the $task variable which you have, for $editable just use false), and what to send after you got it(found in the âtask/showâ template, which sends 4 variables on lines 47-50, you need them all).
thank you so much forĹthe detailed explanation⌠I have tried my best to understand it with my basic skillsâŚ
Please check the code for me here: GitHub - aljawaid/KanboardEmailHistory
Iâm trying to create an action so that:
when the task closes:
I fixed what you had, but did not add any features. If you need more help, again, try and let me know when stuck.
woah thanks foĹthis⌠I had a glance, will test when I get home⌠it seems I was way out lol
thats good, because i didnt test it. i see one thing i missed, forgot to add projectmodel in the âuseâ section.
Can you please review my changes? I missed the description, but I think I have fully done it now. I just need you to have a glance at it as you understand the code for Kanboard a lot better than me.
glanced.
commented on your changes. it will need a lot of fixes.
Iâve got it working and released the first version. Hope itâs useful to others too.