Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Page URL not formatted properly to use in email?

Hi,
I am trying to create and send URL from apex.oracle.com but seems there is some problem in the created URL,
SELECT apex_mail.get_instance_url || APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || v('APP_ID') || ':13:'|| v('APP_PAGE_ID') ||'::NO::P13_ID:1') into v_PAGE_URL FROM DUAL;
apex_mail.send (
p_to => '[email protected]',
p_template_static_id => 'JOB_REQUISITION',
p_placeholders => '{' ||
' "ORDER_NUMBER":' || apex_json.stringify( 'l_business_ref' ) ||
' ,"CUSTOMER_NAME":' || apex_json.stringify( 'some_value' ) ||
' ,"MY_APPLICATION_LINK":' || apex_json.stringify(v_PAGE_URL) ||
' ,"ORDER_URL":' || apex_json.stringify( 'some_value' ) ||
'}' );
No idea why pls/apex//pls/apex is duplicated in the output URL? APEX version is 21.2 and it is apex.oracle.com
Answers
-
Can you check what [apex_mail.get_instance_url] will return, if the returned URL is having pls/apex then you can remove it from:
Manage Instance \ Instance Settings \ Email \ Application Express Instance URL
-
Hi,
I was looking for such options but was unable to find them in apex.oracle.com as seems instance settings can't be accessed or maybe I am missing the navigation. thanks
-
This could very well be a bug with friendly URLs.
apex_mail.get_instance_url returns https://apex.oracle.com/pls/apex/
APEX_PAGE.GET_URL or APEX_UTIL.PREPARE_URL as non-friendly URL returns f?p=...
So, if you combine these two, it works as expected.
-
Hi, I tried all these options but these both are prefixing /pls/apex which is causing problem. I tried SELECT APEX_PAGE.GET_URL ( p_page => 1, p_items => 'P1_X,P1_Y', p_values => 'somevalue,othervalue' ) f_url_1, APEX_UTIL.PREPARE_URL('f?p=&APP_ID.:1:&APP_SESSION.::::P1_X,P1_Y:somevalue,othervalue') FROM DUAL
When I am trying following in SQL using SQL Commands then URL is correct but same code when I am trying in APEX form using processes or pl_sql having the problem,
SELECT apex_mail.get_instance_url || APEX_PAGE.GET_URL (p_page => 13, p_items => 'P13_ID',p_values => 1 )
FROM DUAL;
I need to send this URL in email so the user will click to open the form. Any suggestions please to get resolved on apex.oracle.com.
-
If you cannot access the internal admin console you cannot do it, [APEX_PAGE.GET_URL, and APEX_UTIL.PREPARE_URL] will always return the full path.
For your case you can add <a href=""> in your email body and the href source will be something like:
SELECT APEX_MAIL.GET_INSTANCE_URL || 'f?p=' || V('APP_ID') || ':13:' || V('APP_PAGE_ID') || '::NO::P13_ID:1' FROM DUAL;