APEX: Send Mail Thru Report Page


Hi,

You published a useful interactive report for your users and now want to let them get that as email also through that page.

Here you can find a basic example..

  • Go to your report page from Application Builder panel
  • Create a page item button 
    • Pick Defined by Dynamic Action as button action
  • Right click to your brand new Dynamic Action and select Create.
dyn_act
APEX Dynamic Action

As you can see above, we have to create this action with some conditions. Such as:

  • Event: Click
  • Selection Type: Button
  • Button: address your button which you ‘ve just created. This item will trigger your email sending process.

Once we completed these steps, we can add a True action. You ‘ll see a button named Add True Action at your Dynamic Action Edit page. You can also create one by choosing from right click menu.

true_act
Adding a TRUE action

You may want to uncheck Fire On Page Load. Because.. Well we want to trigger it by clicking our button, manually :)

So.. Now we need this PL/SQL code which will take care of sending email via Oracle APEX.

I ‘ll share 2 basic examples with you. One for plain-text emails, one for HTML based ones.

I personally prefer to send mails in HTML format… But it ‘s up to you and depends on your needs..

 

It is pretty easy, right? Just give the right parameters and a simple sentence as email body. You can always use variables to collect these informations like i did..

If you want to go with HTML format, then you ‘ll need some extra time to create a good-looking and small-sized body. That ‘s all :)

Once you store these codes you ‘ve wrote and apply the changes onto your report page, you can start using your button. It should be sending emails to given address. Click on your button and wait couple of minutes to receive it.

I am not going to remind you not to copy everything from my sample snapshots. You do need to change email addresses etc. :)

Should you want to add some extra features on this dynamic action, you can add another True action(s) as well.

You may need to.. Otherwise someone would be able to click on that button more than necessary and we don ‘t want to spam people :)

Let ‘s add a Confirmation action..

 

conf_act

  • Right Click, Create
  • Action: CONFIRM

Now you ‘ll be prompted to click OK everytime you click on your email button..

O.K. but not enough? Well let ‘s hide the button after it ‘s got clicked.

hide

  • Now we have a button on our report page
  • Our authorized report viewers can click on it to send email
  • We have a confirmation dialog before trigger
  • Our email send button will be hidden once it used.

Dag!

Advertisement

1 thought on “APEX: Send Mail Thru Report Page

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.