Send mail after Leave Application saved

Hi guys, 

I noticed there is a field called 'Follow by email' on Leave Application but it seems to only send out 'Messages', not real email ?
What I am trying to accomplish is to pop up an email with some message after a Leave Application saved. 

I got that with this code as Customize Script: https://gist.github.com/nathando/4bd88afb66dccfb5b1ec
Note that 'notified_by_email', is my own field to track if email been sent.
 If leave application been changed, this will reset to 0, and it will prompt to send email again.

Because I don't know which event triggered after email sent, I set the notified_by_email
as long as the dialog popped up. That works well for most of the case. 
But if after dialog popping up, if user decide to hide that then the Document on Client is out-synced with on Server... 

How should this be solved ? Thank you!



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/358a3bcb-e242-45cd-b44e-dd4006055b29%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Are you doing this on frappecloud or on your own server? These customizations can be done much easily on the server side.

best,
Rushabh


On 25-Jul-2014, at 11:57 am, Nguyen Do Le Bao <na...@gmail.com> wrote:

Hi guys, 

I noticed there is a field called 'Follow by email' on Leave Application but it seems to only send out 'Messages', not real email ?
What I am trying to accomplish is to pop up an email with some message after a Leave Application saved. 

I got that with this code as Customize Script: https://gist.github.com/nathando/4bd88afb66dccfb5b1ec
Note that 'notified_by_email', is my own field to track if email been sent.
 If leave application been changed, this will reset to 0, and it will prompt to send email again.

Because I don't know which event triggered after email sent, I set the notified_by_email
as long as the dialog popped up. That works well for most of the case. 
But if after dialog popping up, if user decide to hide that then the Document on Client is out-synced with on Server... 

How should this be solved ? Thank you!



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/358a3bcb-e242-45cd-b44e-dd4006055b29%40googlegroups.com.

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



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/13965E25-E691-473B-8AFB-8ACA166DF28C%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Also checkout the new Email Alert :) Setup > Email Settings > Email Alert


On 25-Jul-2014, at 11:57 am, Nguyen Do Le Bao <na...@gmail.com> wrote:

Hi guys, 

I noticed there is a field called 'Follow by email' on Leave Application but it seems to only send out 'Messages', not real email ?
What I am trying to accomplish is to pop up an email with some message after a Leave Application saved. 

I got that with this code as Customize Script: https://gist.github.com/nathando/4bd88afb66dccfb5b1ec
Note that 'notified_by_email', is my own field to track if email been sent.
 If leave application been changed, this will reset to 0, and it will prompt to send email again.

Because I don't know which event triggered after email sent, I set the notified_by_email
as long as the dialog popped up. That works well for most of the case. 
But if after dialog popping up, if user decide to hide that then the Document on Client is out-synced with on Server... 

How should this be solved ? Thank you!



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/358a3bcb-e242-45cd-b44e-dd4006055b29%40googlegroups.com.

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



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/D71A189E-2A9A-4E4E-8E06-AF80D641F87F%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi,

Have you enabled scheduler?

Thanks,
Anand.


On Fri, Jul 25, 2014 at 11:57 AM, Nguyen Do Le Bao <na...@gmail.com> wrote:
Hi guys,

I noticed there is a field called 'Follow by email' on Leave Application but it seems to only send out 'Messages', not real email ?
What I am trying to accomplish is to pop up an email with some message after a Leave Application saved.

I got that with this code as Customize Script: https://gist.github.com/nathando/4bd88afb66dccfb5b1ec
Note that 'notified_by_email', is my own field to track if email been sent.
If leave application been changed, this will reset to 0, and it will prompt to send email again.

Because I don't know which event triggered after email sent, I set the notified_by_email
as long as the dialog popped up. That works well for most of the case.
But if after dialog popping up, if user decide to hide that then the Document on Client is out-synced with on Server...

How should this be solved ? Thank you!



Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/358a3bcb-e242-45cd-b44e-dd4006055b29%40googlegroups.com.

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




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    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 view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF3sfdLLvZTeA3Z56Joc_6C2dyq%2Bwy5xgAmOHu_5Dteukg%40mail.gmail.com.

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