Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending the email wftask merge tags
#1
I want to create some functionality: when a comment is placed, we send e-mails to the person mentioned in the comment. In that e-mail, I'd like to show the rest of the conversation. To that end I'd like to extend the existing workflow merge tags to accomodate a new tag that gets and prints the conversation that preceeded this comment. How would I start extending this functionality?
Reply
#2
Hi

The hard part here is to parse the body of the comment to extract "mentions", that can be tricky. maybe add a "getMentions" metavariable or function...

You have pretty much all the control you need already upon the conversation to show with the "comments" metavariable: https://corebos.com/documentation/doku.php?id=en:email_workflows

if you need to add more, that happens here: https://github.com/tsolucio/corebos/blob/master/modules/com_vtiger_workflow/VTSimpleTemplate.inc#L136
Joe
TSolucio
Reply
#3
Well the mentions work fine, I hardcoded them into the workflow task condition and set the corresponding email address for each task. Otherwise we'd need a mention <-> field mapping. Maybe some future thing.

About the rest, thanks, let me check what I can do with that.
Reply
#4
I'm having a problem with this functionality. We use the regular ModComments module for everything, also for tickets. Now I noticed the comments were coming up empty when testing in tickets, so I dumped the query produced here to the log and noticed it it hardcoded to search for comments in the 'ticketcomments' table, not the regular modcomments table. This is an issue for u since we always work on the modcomments module.

How would you propose we fix this?

Come to think of it: this won't help us. We use workflow tasks that trigger on the first save of the comment, not the parent module. What I want is not get the comments related to the parent, but the siblings of the comment we're firing on. The reason is that we use the '@' symbol followed by a name when searching through the comment content using the regular condition functionality. That is used to determine who should receive the e-mail.

So what I really want is to use this metavariable to get the siblings of the comment that triggers the workflow task, and then use the same ordering and date formatting technique. Preferably by extending this function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)