Oracle by Example brandingOracle Application Express 18: Email Templates (1 of 2) - Configure the Template

section 0Before You Begin

This 15-minute tutorial demonstrates how to create an email template to send out email notifications for upcoming milestones in the Sample Projects application.

This is the first tutorial in the series Oracle Application Express 18: Email Templates. Read the tutorials in the following sequence:

Background

In this tutorial, create an email template for the Sample Projects application that sends out email notifications for upcoming milestones. First, you install the Sample Projects application. Second, you load and modify a sample email template. In a subsequent tutorial, you create a procedure to call the template and add a button and process to call the procedure.

What Do You Need?

To complete this tutorial you need:

  • Access to Oracle Application Express release 18.1 or later.
  • Install the Sample Projects application.
  • Have your Instance administrator configure Oracle Application Express to send mail. See Configuring Email.

Accessing Your Development Environment

How you sign in and access Oracle Application Express release depends upon where Oracle Application Express resides. Oracle Application Express may reside in a local on-premises Oracle Database or in a hosted environment, such as the Oracle Cloud. The sign in credentials you use to sign in differ depending upon the installation type.

  • Free Workspace: Give Oracle Application Express a test run by signing up for a free workspace. To request an evaluation workspace, go to apex.oracle.com, and click Get Started.
  • Oracle Cloud: Develop and deploy applications without worrying about infrastructure, repair, and downtime. Oracle Application Express is available in Exadata Express Cloud Service and Database Cloud Service. However, you need to manually customize your databases to install and enable Oracle Application Express. To learn more, see Database Cloud Service.
  • Oracle Application Express On-premises: Install Oracle Application Express directly within any Oracle Database and then sign in to your workspace using your sign in credentials. For details on your sign in credentials, contact your administrator or see Oracle Application Express Installation Guide.
  • Oracle Application Express Pre-Built VM: Install a Pre-Built Virtual Machine (VM) which includes an Oracle Database and Oracle Application Express 18.1. To learn more, see Hands-On Labs.
    Once the VM is installed, start the VM:
    • Click the big red circle labeled Start.
    • Click the APEX shortcut, or enter the following URL:
      http://localhost:8080/ords/f?p=4550:1
    • When prompted to sign in, enter the sign in credentials (unless given other credentials to use):
      • Workspace: obe
      • Username: obe
      • Password: oracle

Note your Application ID may be different when compared to the screenshots in this tutorial. Your Application ID is assigned automatically when you create the application.


section 1Install the Sample Projects

To install Sample Projects:

  1. Sign in to your development environment.
  2. On the Workspace home page, click Packaged Apps.
    Packaged Apps icon
    Description of the illustration pack_app_icon.png
  3. The Packaged Apps Gallery appears.

  4. Enter Sample Projects in the search field and press ENTER.
  5. Click Sample Projects.
  6. Click Install Packaged App.
  7. When prompted, click Next to continue.
  8. Click Install Packaged App again. The Packaged App Details page appears and the message, Application installed displays in the upper left corner.
    Application installed message
    Description of the illustration installed_message.png

section 2Run and Review the Sample Projects Application

To run the Sample Projects application:

  1. On the Packaged App Details page, click the Run icon.
  2. On the Sign In page, enter your workspace username and password and click Login. The Sample Projects application appears.
    Milestonelink on navigation menu
    Description of the illustration sample_projects_hm.png
  3. In the left navigation menu, click Milestones. The Milestones page appears.
    Milestones
    Description of the illustration sample_projects_pg1.png
  4. In the tasks that follow you create an email template, add a procedure to call the template, and then add a button and process on this page to call the procedure.

  5. View the Milestone page in Page Designer. Click Edit Page 6 on the Runtime Developer Toolbar at the bottom of the window.
    Edit
                    Page 6
    Description of the illustration edit_pg_6.png
  6. Page Designer displays page 6.


section 3Load a Sample Email Template

To load a sample template:

  1. Navigate to the Email Templates page:
  2. Click Create Email Template.
  3. On the Details page, click Load Event Reminder.
    Load Event Reminder
    Description of the illustration event_reminder_temp.png

    The template appears.


section 4Modify the Sample Email Template

Update the sample email template to work with the Milestone page and EBA_DEMO_PROJ_MILESTONES table.

To update the email template:

  1. Under Identification:
    • Template Name: Enter Milestones
    • Email Subject: Enter Upcoming Milestones
  2. Update the template for HTML-based email. Under HTML Format:
    • Header - Replace the existing Header with:
    • <b style="font-size: 24px;">Sample Projects</b>
    • Body - Replace the existing Body with the code in html_email_body.txt.
    • Footer - Replace the existing Footer with:
    • Visit the Sample Projects application to update your email address if necessary.
                        
  3. Update the template for non-HTML-based email.
    • Content - Replace the existing template with:
    • Hello #INVITEE#,
      
      This email is to remind you of upcoming milestones.
      
      Project:    #PROJECT#
      Milestone:  #MILESTONE#
      Due Date:   #DUE_DATE#
                      
  4. Click Create Email Template at the top of the page. The new template, Milestones, appears on the Email Templates page.
    Create Email Template
    Description of the illustration new_email_template.png
  5. Review Sample API Usage region:
    • Select the Milestones template. The Template Details page appears.
    • Scroll down to Sample API Usage.
      Sample API Usage
      Description of the illustration sample_api_usage.png
    • Review the Sample API Usage region. Based on your template, this region displays syntax for using the apex_mail.send API. You will use this syntax in the next tutorial to create a procedure
  6. Return to the Workspace home page. Click the Oracle APEX logo in the upper left of the window. The Workspace home page appears.
  7. This ends the first tutorial in this series.


next stepNext Tutorial

Oracle Application Express 18: Integrating Email Templates (2 of 2) - Call the Template


more informationWant to Learn More?