Plugin Sample: Purchase Order Email with custom subject line

Samples and Examples of using the Jiwa 7 framework - including plugins, stand-alone applications and scripts.

Plugin Sample: Purchase Order Email with custom subject line

Postby renes » Fri Oct 17, 2014 3:12 pm

The email function in Purchase Orders can be customized with an individual Subject Line and an individual Message Body. The customization is driven by the 'Purchase Order Custom Email' plugin. This plugin needs to be modified.

By default the standard 'Purchase Order Custom Email' plugin inserts the reference from the Purchase Order Reference field into the Subject line of the email and the message body defined in the Plugin itself.

To automatically insert a customized Subject line and Message Body into a purchase order the copied and renamed plugin needs to be changed as follows:
1. Copy the 'Purchase Order Custom Email' plugin and give it a new name
2. Change the Author with the company name or developer name
3. Make sure the Jiwa version is correct in the Version field
4. In the plugin code scroll down until you see this code: (Line 46 to 49)
Code: Select all
Dim lSubject As String = "This is the subject"
Dim lStaffFname As String = ""
Dim lStaffSName As String = ""
Dim lMessage As String = "This is the email message"

5. Enter the customized subject line between the double quotes for
Code: Select all
Dim lSubject As String = "This is the subject"

6. Enter the customized Message Body into the double quotes for:
Code: Select all
Dim lMessage As String = "This is the email message"

7. Scroll down until you see this code: (Lines 65 to 68)
Code: Select all
lNameToGiveAttachment = PurchaseOrderForm.PurchaseOrder.OrderNo
lEmailTo = PurchaseOrderForm.PurchaseOrder.Creditor.EmailAddress
   lSubject = PurchaseOrderForm.PurchaseOrder.Reference

8. Replace the above code with this code
Code: Select all
lNameToGiveAttachment = PurchaseOrderForm.PurchaseOrder.OrderNo
lEmailTo = PurchaseOrderForm.PurchaseOrder.Creditor.EmailAddress
If PurchaseOrderForm.PurchaseOrder.Reference.Trim.Length > 0 Then
   lSubject = PurchaseOrderForm.PurchaseOrder.Reference
End If

9. Click the 'Compile' button in the Plugin Code Toolbar and save
10. Close and re-open Jiwa
Attachments
Plugin Purchase Order Custom Email (Custom Subject & Message Body).xml
Customized Purchase Order Custom Email plugin
(30.62 KiB) Downloaded 146 times
renes
Occasional Contributor
Occasional Contributor
 
Posts: 11
Joined: Tue Jan 28, 2014 3:29 pm
Topics Solved: 2

Return to Samples and Examples

Who is online

Users browsing this forum: No registered users and 2 guests