Writing custom code to generate an alert when a workflow reaches a certain stage

Hi,


I need help to achieve the following after setting up a workflow:
+ Send out an alert (email or sms) when a workflow reaches a certain stage

Example workflow:
+ Open support ticket > Contact Customer > Resolve Ticket > Close

When the flow reaches the “Resolve Ticket” stage an email must be sent to “Support Team” and “Customer”.

I need steps as I am 100% new to ERPNext and have only managed to create a workflow and stages.

What I read on the web and forum is about custom code both client and server side on the module and doctype
level, I just have no idea what to do with that information because non of it is A B C clear. Please understand that
our experience levels are not the same and I don’t mind being teased :stuck_out_tongue:



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ab24a85c-9854-467e-b2e6-dc1bfcc1a21f%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Ed,

Welcome to the forum. :)

Easiest way to do this is to add a Custom Script (server) to Support Ticket.

And send the mails using on_update method.

Note Custom Scripts (server) are appended to the main script (support_ticket.py) and are a bit hacky and all the functions must start with a left tab as they are a part of a subclass).

This is how Custom Server Scripts are executed:

https://github.com/webnotes/wnframework/blob/master/webnotes/model/code.py#L104

best,
Rushabh

T: @rushabh_mehta

On 15-Jun-2013, at 6:22 PM, Ed Dikotope <ed...@gmail.com> wrote:

Hi,

I need help to achieve the following after setting up a workflow:
+ Send out an alert (email or sms) when a workflow reaches a certain stage

Example workflow:
+ Open support ticket > Contact Customer > Resolve Ticket > Close

When the flow reaches the "Resolve Ticket" stage an email must be sent to "Support Team" and "Customer".

I need steps as I am 100% new to ERPNext and have only managed to create a workflow and stages.

What I read on the web and forum is about custom code both client and server side on the module and doctype
level, I just have no idea what to do with that information because non of it is A B C clear. Please understand that
our experience levels are not the same and I don't mind being teased :P



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ab24a85c-9854-467e-b2e6-dc1bfcc1a21f%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2846E33B-BA66-4FEF-9C19-9B5F41FC229D%40erpnext.com.

For more options, visit https://groups.google.com/groups/opt_out.