Implementing the sendReminder Method

You have the Send Reminder activity, but have not yet implemented it. You will set the implementation type of its Main Task as a method. This method sends a reminder e-mail.
  1. Right-click on the Send Reminder activity and click Main Task. The Main Task dialog box appears.
  2. Verify that Method is selected in the Implementation Type drop-down list. If not, set it.
  3. In the Method panel, click New. The New Process Method dialog box appears.
  4. Enter sendReminder in the Method Name text box, and click OK.
  5. Back in the Main Task dialog box, click Edit. A PBL code editor opens for the sendReminder method.
  6. Enter the following code, exactly as shown, but replace <your e-mail address> with an e-mail address you have access to:
    // Send reminder e-mail
    
    reminderEmail as Mail
    reminderEmail = Mail()
    reminderEmail.from="<your e-mail address>"
    reminderEmail.recipient=Participant(report.submittedBy).email
    reminderEmail.subject="Expense Report Message"
    reminderEmail.message="This is to remind you that a report you submitted requires editing."
    
    sender as MailSender
    sender = MailSender(reminderEmail)
    
    sender.send()
  7. Save and close the editor.
  8. For this to work, you also need to configure the Studio engine with a working outbound (SMTP) e-mail server. In the Project Navigator, right-click on the top of the ExpenseManagent project, and click Engine Preferences (Engine Preferences icon 
				). The Engine Preferences dialog appears.
  9. Enter the name of your SMTP mail server in the SMTP Mail Server Name field, for example smtp.xyzcorp.com.
  10. Click OK. The engine dialog box closes with the new settings.