Defining the sendReminder Method

You now have the Send Reminder activity, but have not yet defined how it will work. You will set its Main Task as a method which will send an 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.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 will also need to configure the Studio engine so that it knows where to send e-mail. In the Project Navigator, right-click on the top of the ExpenseManagent project, and click Engine Preferences (Engine Preferences icon
				). The Engine dialog box appears.
  9. Enter the name of your SMTP mail server in the Mail Server Name field, for example smtp.xyzcorp.com.
  10. Click OK. The engine dialog box closes with the new settings.