Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Email Approver System included in this article acts as a email polling system that fetches emails and complete assignments periodically based on configurations.

Thai

ระบบการอนุมัติอีเมลที่รวมอยู่ในบทความนี้ทำหน้าที่เป็นระบบการลงคะแนนทางอีเมลที่ดึงอีเมลและการมอบหมายที่สมบูรณ์เป็นระยะตามการกำหนดค่า


Figure 1: Setting up the listeners

There can be more than 1 listener set at any point of time. Each listener, technically, will be a process instance that repetitively run in a loop until terminated by the user.

Thai

รูปที่ 1: การตั้งค่าผู้ฟัง

สามารถตั้งค่าฟังได้มากกว่า 1 รายการ ณ เวลาใดก็ได้ ผู้ฟังแต่ละคนในทางเทคนิคจะเป็นอินสแตนซ์ของกระบวนการที่เรียกใช้ซ้ำ ๆ ในลูปจนกว่าผู้ใช้จะถูกยกเลิก

Configurations

Thai

การกำหนดค่า

Figure 2: IMAP Email Settings

IMAP Email Settings must be configured so that it will check a specific email's inbox for new incoming mails.

It is important to create a dedicated email address to receive such "response" emails so that the the execution code block does not spend too much time going through irrelevant emails.

Thai

รูปที่ 2: การตั้งค่าอีเมล IMAP

การตั้งค่าอีเมล IMAP ต้องได้รับการกำหนดค่าเพื่อให้สามารถตรวจสอบกล่องจดหมายเข้าของอีเมลเพื่อรับอีเมลขาเข้าใหม่

สิ่งสำคัญคือต้องสร้างที่อยู่อีเมลเฉพาะเพื่อรับอีเมล "ตอบกลับ" ดังกล่าวเพื่อให้การบล็อกรหัสการดำเนินการไม่ใช้เวลามากเกินไปในการอ่านอีเมลที่ไม่เกี่ยวข้อง

Figure 3: Listener Settings

Listener Settings needs to be also configured to determine the frequency of checking and emails to be matched too.

Thai

รูปที่ 3: การตั้งค่าการรับฟัง

การตั้งค่าฟังจะต้องมีการกำหนดค่าเพื่อกำหนดความถี่ของการตรวจสอบและอีเมลที่จะจับคู่ด้วย

Warning

Take note that the checking interval is also subjected to the Deadline Checker interval set in Joget Workflow's system settings. Please ensure the Process Deadline Checker Interval is enabled. This can be located at Admin Bar > General Settings > Timer Settings > Process Deadline Checker Interval

Thai

โปรดทราบว่าช่วงการตรวจสอบจะขึ้นอยู่กับช่วงเวลา Deadline Checker ที่กำหนดไว้ในการตั้งค่าระบบของ Joget Workflow โปรดตรวจสอบให้แน่ใจว่าช่วงเวลาการประมวลผลตัวตรวจสอบกำหนดเวลาสิ้นสุดลงแล้ว ซึ่งสามารถดูได้ที่แถบผู้ดูแลระบบ> การตั้งค่าทั่วไป> การตั้งค่าตัวจับเวลา> ช่วงเวลาตรวจสอบกระบวนการกำหนดเวลา

Figure 4: Listener Settings - Subject and Content

Subject and Content Patterns are very important.

Make sure that you match the content of the outgoing mail that you send out in your other Joget Workflow App.

It may take a few tries to get it right so you can turn on the Debug Mode to get the relevant logs for debugging purpose.

Thai

รูปที่ 4: การตั้งค่าการรับฟัง - หัวเรื่องและเนื้อหา

รูปแบบหัวเรื่องและเนื้อหามีความสำคัญมาก

ตรวจสอบให้แน่ใจว่าคุณตรงกับเนื้อหาของเมลขาออกที่คุณส่งออกไปใน Joget Workflow App อื่น

อาจต้องใช้เวลาสักครู่เพื่อให้ถูกต้องเพื่อให้คุณสามารถเปิดโหมด Debug เพื่อรับบันทึกที่เกี่ยวข้องสำหรับการดีบัก

Code Block
titleContent Pattern
{form_approval_new_application_approval_action_status}
{unuse}
{unuse}ID: {processId}
{unuse}Remarks: [{form_approval_new_application_approval_action_remarks}]
{unuse}
Info
titleInfo

You may be wondering where does {form_approval_new_application_approval_action_status} comes from. It is actually the field element name of said field. Just use the Inspect Element feature in your browser to acquire the field element name and add the prefix "form_" to it. (see sample screenshot below) This will retrieve the value in the email content and set it into the form data. 

Thai

คุณอาจสงสัยว่า {form_approval_new_application_approval_action_status} มาจากไหน จริงๆแล้วมันเป็นชื่อองค์ประกอบของเขตข้อมูลดังกล่าว เพียงใช้คุณสมบัติตรวจสอบองค์ประกอบในเบราว์เซอร์ของคุณเพื่อรับชื่อองค์ประกอบฟิลด์และเพิ่มคำนำหน้า "form_" (ดูภาพตัวอย่างด้านล่าง) สิ่งนี้จะดึงค่าในเนื้อหาอีเมลและตั้งเป็นข้อมูลแบบฟอร์ม


Inspect element screenshot


Sample email to be sent out configured in Email Tool from the system to the respondent.

Thai

ตัวอย่างอีเมลที่จะส่งออกที่กำหนดค่าในเครื่องมืออีเมลจากระบบไปยังผู้ตอบ

Code Block
The following application required your approval with details:
====================================
Name : #form.seaa_application.name#
Email : #form.seaa_application.email#
ID: #assignment.processId#
====================================
Please reply this email with keyword "Approved", "Rejected" or "Clarification Required". 
If your have remark message, please fill inline between the square brackets below.
Remarks: [ ]
==  This is a system generated message. ==

Sample email

Thai

ตัวอย่างอีเมล

Code Block
The following application required your approval with details:
====================================
Name : Etta
Email : etta@joget.com
ID: 43_seaa_new_application_approver_process
====================================
Please reply this email with keyword "Approved", "Rejected" or "Clarification Required".
If your have remark message, please fill inline between the square brackets below.
Remarks: []
==  This is a system generated message. ==

Sample email replied by the receiver back to the mailer.

Thai

ตัวอย่างอีเมลตอบกลับโดยผู้รับกลับไปที่จดหมาย

Code Block
Approved

> The following application required your approval with details:
> ====================================
> Name : Etta
> Email : etta@joget.com
> ID: 43_seaa_new_application_approver_process
> ====================================
> Please reply this email with keyword "Approved", "Rejected" or "Clarification Required".
> If your have remark message, please fill inline between the square brackets below.
> Remarks: [356pm approved]
> ==  This is a system generated message. ==

Server log showing email polling and assignment completion.

Thai

บันทึกเซิร์ฟเวอร์แสดงการสำรวจอีเมลและการเสร็จสิ้นการมอบหมาย

Code Block
titleLog
INFO  02 Mar 2016 16:52:50 App: eas - Poll Email tool  - Connect to IMAP for machine@sample-joget.com
INFO  02 Mar 2016 16:52:53 App: eas - Poll Email tool  - IMAP connected for machine@sample-joget.com
INFO  02 Mar 2016 16:52:53 App: eas - Poll Email tool  - Unread Messages: 1
INFO  02 Mar 2016 16:52:54 App: eas - Poll Email tool  - Subject filter for (Re: Email Approval).
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - --- Mail 0: Re: Email Approval ---
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - Sender: Cat Grant <cat-grant@sample-joget.com>
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - Mail Content: Approved____> The following application required your approval with details:__> ====================================__> Name : Etta__> Email : etta@joget.com__> ID: 43_seaa_new_application_approver_process__> ====================================__>__> Please reply this email with keyword "Approved", "Rejected" or "Clarification Required".__>__> If your have remark message, please fill inline between the square brackets below.__> Remarks: [356pm approved]__>__> ==  This is a system generated message. ==__>__>__
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - subject_pattern:
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - subject_reg:
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - subject_reg:
INFO  02 Mar 2016 16:52:55 App: eas - Poll Email tool  - content_pattern: {form_approval_new_application_approval_action_status}__{unuse}__{unuse}ID: {processId}__{unuse}Remarks: [{form_approval_new_application_approval_action_remarks}]__{unuse}__
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - content_reg: \{form_approval_new_application_approval_action_status\}__\{unuse\}__\{unuse\}ID: \{processId\}__\{unuse\}Remarks: \[\{form_approval_new_application_approval_action_remarks\}\]__\{unuse\}__
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - content_reg: (.*?)__([\s\S]*)__([\s\S]*)ID: (.*?)__([\s\S]*)Remarks: \[(.*?)\]__([\s\S]*)__
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: form_approval_new_application_approval_action_status
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: Approved
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: unuse
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: __> The following application required your approval with details:__> ====================================__> Name : Etta__> Email : etta@joget.com
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: unuse
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: >
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: processId
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: 43_seaa_new_application_approver_process
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: unuse
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: > ====================================__>__> Please reply this email with keyword "Approved", "Rejected" or "Clarification Required".__>__> If your have remark message, please fill inline between the square brackets below.__>
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: form_approval_new_application_approval_action_remarks
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: 356pm approved
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - key: unuse
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - value: >__> ==  This is a system generated message. ==__>__>
INFO  02 Mar 2016 16:52:56 App: eas - Poll Email tool  - Submit Form for assignment: 81_43_seaa_new_application_approver_process_approval {approval_new_application_approval_action_status=[Ljava.lang.String;@e992653, approval_new_application_approval_action_remarks=[Ljava.lang.String;@68a31aa1}
I

If there is a match based on the subject or the content, the code block will then retrieve the email's sender information (email) and matches it with an existing user in the system.

If there's a match with an user and if there's a further match with the particular user's assignment, then it will then proceed to complete the assignment.

While completing the assignment, depending on the configurations set, workflow variables' values and/or form data values can be set too.

Thai

หากมีการจับคู่ตามหัวข้อหรือเนื้อหาบล็อกรหัสจะดึงข้อมูลผู้ส่งอีเมล (อีเมล) และจับคู่กับผู้ใช้ที่มีอยู่ในระบบ

หากมีการจับคู่กับผู้ใช้และหากมีการจับคู่เพิ่มเติมกับการมอบหมายของผู้ใช้โดยเฉพาะจากนั้นก็จะดำเนินการให้เสร็จสิ้นการมอบหมาย

ขณะดำเนินการมอบหมายให้เสร็จสมบูรณ์ขึ้นอยู่กับชุดการกำหนดค่าคุณสามารถตั้งค่าตัวแปรตัวแปรเวิร์กโฟลว์และ / หรือค่าข้อมูลฟอร์มได้

Figure 5: Optional - SMTP Email Settings for Auto Reply

You can configure this section if you want the listener to automatically reply to email that it matches.

Thai

รูปที่ 5: ตัวเลือก - การตั้งค่าอีเมล SMTP สำหรับการตอบกลับอัตโนมัติ

คุณสามารถกำหนดค่าส่วนนี้หากคุณต้องการให้ผู้ฟังตอบกลับอีเมลที่ตรงกันโดยอัตโนมัติ


Download Demo App


Related Elements

Thai

องค์ประกอบที่เกี่ยวข้อง