Before 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:
- Oracle Application Express 18: Email Templates (1 of 2) - Configure the Template
- Oracle Application Express 18: Email Templates (2 of 2) - Call the Template
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.
Install
the Sample Projects
To install Sample Projects:
- Sign in to your development environment.
- On the Workspace home page, click Packaged Apps.
Description of the illustration pack_app_icon.png - Enter
Sample Projects
in the search field and press ENTER. - Click Sample Projects.
- Click Install Packaged App.
- When prompted, click Next to continue.
- Click Install Packaged App again. The
Packaged App Details page appears and the message,
Application installed
displays in the upper left corner.Description of the illustration installed_message.png
The Packaged Apps Gallery appears.
Run
and Review the Sample Projects Application
To run the Sample Projects application:
- On the Packaged App Details page, click the Run icon.
- On the Sign In page, enter your workspace username and
password and click Login. The Sample
Projects application appears.
Description of the illustration sample_projects_hm.png - In the left navigation menu, click Milestones.
The Milestones page appears.
Description of the illustration sample_projects_pg1.png - View the Milestone page in Page Designer. Click Edit
Page 6 on the Runtime Developer Toolbar at the
bottom of the window.
Description of the illustration edit_pg_6.png
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.
Page Designer displays page 6.
Load a
Sample Email Template
To load a sample template:
- Navigate to the Email Templates page:
- In Page Designer, click the Shared Components
icon on the Page Designer toolbar.
Description of the illustration shared_comp_ico.png - On the Shared Components page, find the Other
Components region and click Email
Templates.
Description of the illustration email_templates.png - Click Create Email Template.
- On the Details page, click Load Event Reminder.
Description of the illustration event_reminder_temp.png The template appears.
The Shared Components page appears.
The Email Templates page appears.
Modify
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:
- Under Identification:
- Template Name: Enter
Milestones
- Email Subject: Enter
Upcoming Milestones
- Update the template for HTML-based email. Under HTML Format:
- Header - Replace the existing Header with:
- Body - Replace the existing Body with the code in html_email_body.txt.
- Footer - Replace the existing Footer with:
- Update the template for non-HTML-based email.
- Content - Replace the existing template with:
- Click Create Email Template at the top of
the page. The new template, Milestones, appears on the Email
Templates page.
Description of the illustration new_email_template.png - Review Sample API Usage region:
- Select the Milestones template. The Template Details page appears.
- Scroll down to 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 - Return to the Workspace home page. Click the Oracle APEX logo in the upper left of the window. The Workspace home page appears.
<b style="font-size: 24px;">Sample Projects</b>
Visit the Sample Projects application to update your email address if necessary.
Hello #INVITEE#,
This email is to remind you of upcoming milestones.
Project: #PROJECT#
Milestone: #MILESTONE#
Due Date: #DUE_DATE#
This ends the first tutorial in this series.
Next
Tutorial
Oracle Application Express 18: Integrating Email Templates (2 of 2) - Call the Template