Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HTML formatting in notifications

user342966Dec 15 2010 — edited Dec 16 2010
Hi,
I have some trouble displaying html formatting in notifications I am sending, they are just displayed as the tags rather than taking effect.
My preferences are to receive mail as html.

My code first gets the text from a message:-
Code:
Fnd_Message.SET_NAME ('PER' , 'XX_HR_LEAVERS_NTF_BODY');
--Fnd_Message.SET_TOKEN('MGR_NAME' , NVL(l_pos_holder_first_name, r_new_starters.mgr_pref_name));
Fnd_Message.SET_TOKEN('EMP_NO' , r_leavers.employee_number);
Fnd_Message.SET_TOKEN('EMP_NAME' , r_leavers.full_name);
l_msg_body := Fnd_Message.get;
--
--
l_msg_html := l_msg_body;

Then calls a procedure to send the notification:-
Code:
FUNCTION send_html_ntf_fn
( p_user_name IN VARCHAR2
, p_subject IN VARCHAR2
, p_html_body IN VARCHAR2 DEFAULT NULL
, p_from_role IN VARCHAR2 DEFAULT NULL
, p_cc_role IN VARCHAR2 DEFAULT NULL
, p_bcc_role IN VARCHAR2 DEFAULT NULL
)
RETURN NUMBER
IS
PRAGMA autonomous_transaction;
l_message_type wf_messages.TYPE%TYPE;
l_message_name wf_messages.name%TYPE := 'XX_HR_GEN_HTML_MSG';
l_nid NUMBER;
BEGIN
--
l_message_type := 'XX_HR';
l_nid:=Wf_Notification.send( UPPER(p_user_name)
, l_message_type
, l_message_name
);
--
IF(p_subject IS NOT NULL)
THEN
Wf_Notification.setAttrText(l_nid, 'SUBJECT' , p_subject);
END IF;
--
IF(p_html_body IS NOT NULL)
THEN
irc_notification_helper_pkg.set_v2_attributes
(p_wf_attribute_value => p_html_body
,p_wf_attribute_name => 'HTML_BODY'
,p_nid => l_nid);
END IF;
--
--
Wf_Notification.denormalize_notification(l_nid);
COMMIT;
--
RETURN l_nid;
--
END send_html_ntf_fn;



I also have this procedure in my package:-
Code:
procedure get_doc_attribute_prc (document_id IN VARCHAR2
,display_type IN VARCHAR2
,document IN OUT NOCOPY VARCHAR2
,document_type IN OUT NOCOPY VARCHAR2) IS
BEGIN
document := document_id;
END get_doc_attribute_prc;

I have a workflow item type XX_HR and a message XX_HR_GEN_HTML_MSG. Under this I have an attribute HTML_BODY_1 as type text and HTML_DOCUMENT_1 as type document with the value as plsql:xxwg_hr_notifications_pkg.get_doc_attribute_prc/&HTML_BODY_1.


I can send text notifications fine but want to be able to send html formatted notifications.
Can anyone give me any pointers where I might be going wrong or let me know a different way to approach this?

Thanks,
Dan
This post has been answered by 552232 on Dec 15 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2011
Added on Dec 15 2010
2 comments
485 views