Skip to main content

Hi just want to ask a few question

 

In K2 Five i already know that is a ootb function to send email using task notification and you can customize the body and etc.

 

But there is a problem, can i customize the body without deploying the workflow to change it. For example are there any smartform / smartobject that can change the body so it can be parameterize. Or there are any other way to change the body. Because K2 Documentation that i read (https://help.k2.com/onlinehelp/k2five/userguide/5.1/default.htm#K2-Workflow-Designer/Use/Toolbox/Basic/SendEmail/Send-Email.htm) just point out that you need to change the body in the workflow.

 

16032iCA364C39648BB19B.jpg

 

Thanks

You should have 2 options of accomplishing this.


 



  1. Create a data field, and store your email body in it. When you need it, just reference that data field in your workflow.

  2. Create a SQL table to store your email bodies, then create a SmartObject from it. When you need it in your worklfow, just call that SmartObject and the Read method to retrieve the email bodies you want.


I have seen people doing it in their workflows, so there should not be any issues with it.


+1 for boringNerd's suggestion - I have found it highly valuable in the long run (for maintenance purposes) to make all notifications data-driven. You can build a Web Service or Stored Procedure that generates the body of a notification on demand from the workflow and any future changes to the notification layout would be made in the database and not in K2.


Ok so you can do that by passing it to a data field in a Workflow.

 

But i have a little problem that is the body of the email need the data from the workflow

 

For Example i have this body

 

Dear User AD

 

There are trixie task that need your response

Sub ID Reference Number : 

Account Number : 

Transaction Type : 

Reason : 

Please click this link "hyperlink"

 

Thank you

Trixie Support

 

How to get the value of Sub Reference No]  for example to fill to the data field (email body, because i think you cannot input the workflow data to the email data field) and how about the styling because i afraid the styling after i get my mail body to a data field will be like this.

 

Dear User AD There are trixie task that need your response Sub ID Reference Number :  Account Number : 

Transaction Type : Reason : Please click this link "hyperlink" Thank you Trixie Support


If you build a stored procedure to put together the body of your notification, then the parameters to the stored procedure can be these workflow datafields. The stored procedure can use them to build the body appropriately.


I agree with the options to use SQL.  If you don't have SQL and are using SharePoint, we have also created a SharePoint list to have the email bodies.  

 

In the email in your list (or in SQL table), it would look like this:  

 

Dear User AD

There are trixie task that need your response

 

Sub ID Reference Number :  eSubIDRefNumber]

Account Number : mAccountNumber]

Transaction Type : TTransactionType]

Reason : aReason]

 

Please click this link  sHyperlink]

 

Thank you

Trixie Support

--------

Then you do a Replace function on anything that is g] in your workflow or stored proc to add your dynamic values.  

 

And as for styling, make sure wherever you store the email body, it is in full HTML to ensure it keeps the line breaks, bullets, etc. 

 

I think i get what solution you guys tell me. 

 

Thank you for the help.


Reply