Auto emailing  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Auto emailing

Postby Atronics » Thu Mar 17, 2016 3:26 pm

How can I get the email plugins (e.g purchase orders) to fire on the PO Status being changed to Sent?
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Auto emailing  Topic is solved

Postby Scott.Pearce » Mon Mar 21, 2016 9:34 am

You can add references to your plugin that refer to some other plugin. This is done via the "Plugin References" tab on Plugin Maintenance. Note, however, that the referenced plugin must be namespaced.

Here's what I did:

1. I created a new plugin called "Email PO Upon Sent".
2. I modified the standard "Purchase Order Custom Email" plugin such that all the classes were wrapped in a namespace called "PurchaseOrderCustomEmail".
3. I also found that I had to change the access modifier of the "EmailPurchaseOrder" function in the "Purchase Order Custom Email" plugin from "Private" to "Public" (so that I could actually access it from the new "Email PO Upon Sent" plugin).

The "Email PO Upon Sent" essentially hooks into some business logic events and keeps track of purchase order status changes. If it finds a purchase order is being saved that has had it's status changed to "Sent", it instantiates a local copy of the "Purchase Order Custom Email" plugin "FormPlugin" class and calls it's "EmailPurchaseOrder" function.

I've attached both the modified "Purchase Order Custom Email" plugin and the new "Email PO Upon Sent" plugin for your perusal.
Attachments
Plugin Email PO Upon Sent.xml
(32.34 KiB) Downloaded 635 times
Plugin Purchase Order Custom Email.xml
(30.54 KiB) Downloaded 595 times
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Auto emailing

Postby Atronics » Tue Mar 29, 2016 3:47 pm

Thanks Scott. That sets me in the right direction.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests