Skip to Main Content
Feature Request FR-2265
Product Area APIs
Status ROADMAP

17 Voters

Email Override From / To

jeffrey kemp APEX Team
· Dec 27 2021

Idea Summary
Add configuration options for apex_mail that allow overriding the Sender and Recipient of all emails for an instance or a workspace.

Use Case
When running an application in a cloned environment (whether a separate instance, or in a separate workspace) for development or test purposes, transactional emails must not be sent out to “real users”; emails sent accidentally can cause significant confusion and disruption in an enterprise which relies on emails for notifications and warnings. 

Preferred Solution (Optional)

  1. optional parameter at the instance and workspace level “EMAIL_FROM_OVERRIDE” that, if set, will replace the Sender of all emails sent by APEX_MAIL from that instance or workspace. This would allow emails to be sent but the recipients can use the Sender to identify where the email came from (e.g. “dev_system@company.com”) and filter them accordingly.

  2. optional parameter at the instance and workspace level “EMAIL_TO_OVERRIDE” that, if set, will replace the Recipient(s) of all emails sent by APEX_MAIL from that instance or workspace. This would allow, for example, a developer to intercept all emails from a dev instance or their workspace, so they can test their application email behaviour without risking sending confusing emails to other people in their organisation.

  3. optional parameters at the instance and workspace level - “EMAIL_HEADER”, “EMAIL_FOOTER”, which would be substituted into the body text/html of all emails sent by APEX_MAIL. Perhaps a suitable placeholder such as #GLOBAL_HEADER#, #GLOBAL_FOOTER# would be used to avoid mangling a html-formatted email.

Related: https://jeffkemponoracle.com/2019/07/wipe-apex-mail-queue/

This is currently on the roadmap for a future release of Oracle APEX.

Known Duplicates

Comments

Comments

  • patrick wolf Admin OP 3.5 years ago

    I do agree with the parameter EMAIL_FROM_OVERRIDE and adding allowing to add something to the subject/e-mail header/footer, but do we really need the parameter EMAIL_TO_OVERRIDE? What would be the exact use case, because a developer wouldn't be able to intercept the mail.

  • jeffrey kemp APEX Team OP 3.5 years ago

    Hi Patrick, the purpose of EMAIL_TO_OVERRIDE is to intercept all emails coming from an instance or a workspace. It would override the recipient of each email. For example, if in the dev env I set it to “jeff@oracle.com” all the emails sent from that instance or workspace should be sent to my email address, regardless of whoever the emails were supposed to go to.

  • blacksh33p OP 3 years ago

    One of those things that if you forget to do this … you won't again :)

  • mark.daems OP 2.7 years ago

    Maybe even better if a pre-send ‘hook’ function could be set that can edit (even delete) the full message before sending it.

    In our environment we would use it to prefix mail subjects and filter all external destination addresses in all non production environments (based on database instance name). This way we could keep workspace configuration identical on all environments.

  • jbarry OP 1.7 years ago

    good idea