Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



Workflow Notifications- Send Notification from a specific Email address

E-mail
User Rating: / 5
PoorBest 
It is a very common business need to send email notifications from Oracle Workflows.
By default the sender in these Workflow Notification emails is always picked from Workflow Global Configurations.

However in many cases, the clients demand that these workflow notification emails are sent from specific email addresses.
Effectively the sender of these notification emails must not be picked up from global workflow configurations.

For example, the sender of workflow email notifications from Learning Management Module could be This e-mail address is being protected from spambots. You need JavaScript enabled to view it
On similar lines, the "Sender and Reply to Address" for the email notifications sent from iRecruitment workflows could be This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This feature is specially useful when you want the recepient of Email notifications to be able to reply to that notification email itself.


Therefore there is often a need to send notification emails in such a way that Sender/From Email address is specific to that workflow notification.

In this step by step demo, you will see a simple workflow that sends notification from a specific email account named "Anil Passi Testing".
The idea is to use the special Workflow attributes that can be attached to the Notification message.

If you do not implement this approach, then sender of the notification will be picked from the Workflow Global Preferences.


Steps for imlpementing this solution are

Step 1. Create a role for the Sender of Workflow Email Notification
This can be created dynamically if one does not exist, using an API named wf_directory.createadhocrole

Step 2. In your workflow, define 3 Attributes
Their names are
#FROM_ROLE
#WFM_FROM
#WFM_REPLYTO
See the sample workflow for how these attributes appear in WF Builder

Step 3. Open the workflow builder and attach these attributes to Workflow Notification Message, by dragging these attributes to the workflow message in workflow builder

Step 4. Set these WF Attributes programmatically in PL/SQL
      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#FROM_ROLE'
                               ,avalue   => 'Enter Name of the Sender Here');
      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#WFM_FROM'
                               ,avalue   => 'Enter Name of the Sender Here');
 
      wf_engine.setitemattrtext(itemtype => itemtype
                               ,itemkey  => itemkey
                               ,aname    => '#WFM_REPLYTO'
                               ,avalue   => 'Enter the Senders Email Address Here');

In reality, you can set these WF Attributes to the desired values as per your logic


In this example, the email from workflow notification will look as shown below.
Notice that sender is specific to our business requirement.


To replicate this test case on your eBusiness Suite environment is two step process.

Step 1. Right click to Save this workflow on your file system. Then open this wft file in WF Builder and save to Database.
http://www.apps2fusion.com/training_demo/anilpassi/wf_override_sender/XXTEST.wft
Note- this workflow will send notification to SYSADMIN from desired email address.

Step 2. Run the below SQL to kick off this workflow and set the special attributes.
Within 3 minutes the email should be sent out by notification mailer.

DECLARE
  l_itemkey    VARCHAR2(100);
  v_role_name  VARCHAR2(100) := 'Anil Passi Testing';
  v_role_email VARCHAR2(100) := ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';
  n_count_role INTEGER := 0;
BEGIN
  SELECT COUNT(*)
  INTO n_count_role
  FROM wf_local_roles
  WHERE NAME = v_role_name;
  IF n_count_role = 0
  THEN
    --If the sender does not exist in WF Local Roles, then create one on the fly
    wf_directory.createadhocrole(role_name       => v_role_name
                                ,role_display_name        => v_role_name
                                ,role_description           => v_role_name
                                ,notification_preference => 'MAILHTML'
                                ,email_address             => v_role_email
                                ,status                       => 'ACTIVE'
                                ,expiration_date           => NULL);
    dbms_output.put_line('Ad Hoc Role Created');
  ELSE
    dbms_output.put_line('Ad Hoc Role Already Exists');
  END IF;

  SELECT oe_order_headers_s.NEXTVAL
  INTO l_itemkey
  FROM dual;
  wf_engine.createprocess('XXTEST'
                         ,l_itemkey
                         ,'XXTEST');
  wf_engine.setitemuserkey(itemtype => 'XXTEST'
                          ,itemkey  => l_itemkey
                          ,userkey  => l_itemkey);
  wf_engine.setitemowner(itemtype => 'XXTEST'
                        ,itemkey  => l_itemkey
                        ,owner    => 'SYSADMIN');

--The three API calls in bold is what you need.
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#FROM_ROLE'
                           ,avalue   => v_role_name);
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#WFM_FROM'
                           ,avalue   => v_role_name);
  wf_engine.setitemattrtext(itemtype => 'XXTEST'
                           ,itemkey  => l_itemkey
                           ,aname    => '#WFM_REPLYTO'
                           ,avalue   => v_role_email);
  wf_engine.startprocess('XXTEST'
                        ,l_itemkey);
  COMMIT;
END;

/



To test your notifications, run this SQL
SELECT *
FROM wf_notifications
WHERE message_name = 'XX_TEST' AND message_type = 'XXTEST' ;


IMPORTANT- Given that our workflow in this demo will send notifications to SYSADMIN, ensure that SYSADMIN does have an email address associated.
This can be checked by running SQL as below
SELECT email_address FROM WF_LOCAL_ROLES WHERE NAME like 'SYSADMIN%';


The Workflow process used for this demo is a very simple workflow, as shown below


The attributes at workflow level are as shown below

 

 

 

 

Comments (33)add
Done
written by Naoufel MAMI , February 01, 2009
It works. Thanks alot and keep updated.

rgds
Naoufel
report abuse
vote down
vote up
Votes: +0
While upload workflow (XXTEST) into the data base
written by Venkat Reddy Pulichintha , February 15, 2009
HI Anil,
While upload the http://www.apps2fusion.com/tra...XXTEST.wft workflow. I am getting below error. I am very new in Workflow
Please help me out. What i am doing the mistaken.
1602: Could not save.
1400: Could not save to database. MODE=UPLOAD EFFDATE=2009/02/15 12:28:20
1404: Please first load this entity or check protect and custom level of ITEM_TYPE 'XXTEST'.


Thanks
Venkat Reddy Pulichintha
report abuse
vote down
vote up
Votes: -1
Send notification from Business event
written by Aymen , March 04, 2009
Hi,

Can we send a notification using just Business event subscription without using Oracle workflow ?

Thanks
report abuse
vote down
vote up
Votes: -1
...
written by Anil Passi , March 04, 2009
You need to subscribe a Workflow to send notification.

Alternately send the notification using the PL/SQL API, as shown in URL below

http://apps2fusion.com/apps/wo...cation-api

Thanks,
Anil Passi
report abuse
vote down
vote up
Votes: +1
Reply to 'While upload workflow (XXTEST) into the data base'
written by Elena , April 03, 2009
Hi Venkat,

I have found this site yesterday and I got the same error.
XXTEST process doesn't have and effective date that's why you got this error.
As well it open in Read-Only mode.

I have made the same process manually and it worked for me. It put the effective date.

Regards,
Jelena
report abuse
vote down
vote up
Votes: +0
Error when executing workflow
written by Sreenivasa , May 25, 2009
Hi Anil,

I am getting the following error when trying to execute my custom workflow. Please advice.

1. Compiled the package in APPS schema.
2. Uplaoded the wft file.
3. Then tried to invoke the WF using the following code:

DECLARE
l_itemkey VARCHAR2(100);
v_role_name VARCHAR2(100) := 'SYSADMIN';
v_role_email VARCHAR2(100) := 'XXXX';
n_count_role INTEGER := 0;
BEGIN

SELECT xxitdcus.demand_seq_s.NEXTVAL
INTO l_itemkey
FROM dual;
wf_engine.createprocess('ITDDMDIN'
,l_itemkey
,'ITD_DEMAND_APPROVAL');
wf_engine.setitemuserkey(itemtype => 'ITDDMDIN'
,itemkey => l_itemkey
,userkey => l_itemkey);
wf_engine.setitemowner(itemtype => 'ITDDMDIN'
,itemkey => l_itemkey
,owner => 'SYSADMIN');

wf_engine.startprocess('ITDDMDIN'
,l_itemkey);
COMMIT;
END;
/


Error in Workflow ITDDMDIN/1006 ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SET_STATUS_APPR'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


Thanks & Regards,
Sreenivasa
report abuse
vote down
vote up
Votes: +0
Workflow Notification From Alert
written by Sujit M Sakalkale , May 30, 2009
Hi Anil,

Can we send work flow notification from Alert?
report abuse
vote down
vote up
Votes: +0
Pure White Gold Halendi Ugg Sandals
written by Pure White Gold Halendi Ugg Sandals , July 28, 2009
My wife-to-be and I were at the county clerk's office for our marriage license.Sand Classic Mini Ugg b***s After recording the vital information -- names, dates of birth, etc. -- the clerk handed me our license and deadpanned,Amethyst Gypsy Ugg Sandals "No refunds, no exchanges, no warranties."

report abuse
vote down
vote up
Votes: +0
Workflow notification
written by grace de guzman , September 18, 2009
We have "Approve" and "Reject" link below the notification mail. Is it possible to approve/reject the notification on the email itself, thus the approver need not to log in to Oracle? Kindly advise.

When the approver clicks the "Approve" or "Reject" link, it will create an email add***sed to the wf mailer. But the notification was not really approved or rejected upon checking its status.

Thank you very much!
report abuse
vote down
vote up
Votes: +0
reset sysadmin email add***s
written by CC , October 21, 2009
Hi Anil,

workflow error messages are currently send to sysadmin email add***s. I want to change the sysadmin email add***s. can yo tell me where can i change the sysadmin email add***s.

thanks
CC
report abuse
vote down
vote up
Votes: +0
ugg sale
written by ugg sale , November 12, 2009
NFL Jerseys discount nfl jerseys C***p nfl jersey wholesale nfl jerseys
discount ugg b***s ugg classic cardy ugg sale buy ugg b***s
timberland b***s timberland s***s discount timberland Classic Timberland
ugg store ugg b***s online ugg sale discount ugg
cell phone audio electronics buy Mp4 Players Hair Straighteners
ugg b***s online discount ugg b***s C***p ugg new ugg b***s
ed hardy store ed hardy caps ed hardy clothing ed hardy jeans
UGG b***s ugg discount ugg b***s sale ugg cardy

report abuse
vote down
vote up
Votes: +0
send content from sql to multiple ids
written by Jyoti S , February 19, 2010
Hi Anil,
You are a life saver, your articles are very user friendly, appreciate the services you are giving for new comers to this horizon.
Coming to my question: I have the roles defined with an associated email, so i assume that i can skip the adhocrole portion of your code and use the rest, but can i use the same process to send the email to multiple ids how do i do that, and as the output that i want to send - comes from a sql , can i use a sql here?

Thanks,
Jyoti
report abuse
vote down
vote up
Votes: +0
...
written by Anil Passi- , February 19, 2010
Hi J

wf_directory also has another API for adding users to a role. I request you check the API as I dont remember exact name of that API

Thanks,
AP
report abuse
vote down
vote up
Votes: +0
...
written by Anil Passi- , February 19, 2010
Simply google on
open source oracle workflow notifications

This should take you to the article that contains source code for download

Thanks,
Anil Passi
report abuse
vote down
vote up
Votes: +0
Sending multiple records in a notification with a table format
written by Somnath , March 24, 2010
Hi AP,
I want to send multiple records in a notification with a table format.How to do that . please help.

Somnath
report abuse
vote down
vote up
Votes: +0
fdf
written by vibram , July 13, 2010
i believe you are a good writer
report abuse
vote down
vote up
Votes: +0
SEND OTHER INFORMATION IN A NOTIFICATION
written by LFG , August 16, 2010
Hi Anil , if I want to send in a notification other information like start date and hour of the process, end date date and hour of the process, number of records loaded, bad records, etc, etc....how can I do this????

Thanks you very much
report abuse
vote down
vote up
Votes: +0
Send Notification To Specific Email Add***s
written by M.S.R , December 27, 2010
Hi,
Can any one help me on the requirement like
I want to send the wf notifications to a specific emial add***s which are not related to the oracle users
report abuse
vote down
vote up
Votes: +2
http://www.usajersey.org wholesale jerseys
written by nfl jerseys , January 11, 2011
Coming to my question: I have the roles defined with an associated email, so i assume that i can skip the adhocrole portion of your code and use the rest, but can i use the same process to send the email to multiple ids wholesale nfl jerseys how do i do that, and as the output that i want to send - comes from a sql , can i use a sql here?
report abuse
vote down
vote up
Votes: +0
Email Approval Notification
written by NDG , January 25, 2011
Hi,
I have set the outlook express template using OAM,I want the approval notification to go to outlook express mail from where the approver can directly approve or reject,How it can be done?
report abuse
vote down
vote up
Votes: +0
http://www.all-star-s***s.net/ n**e outlet
written by n**e outlet , February 23, 2011
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam iaculis iaculis quam. Donec eu dui. Morbi quis nulla. Integer vulputate sollicitudin est. Integer a sem in tortor interdum faucibus.
report abuse
vote down
vote up
Votes: +0
yves saint laurent sunglasses
written by laurent , March 03, 2011

Your article is very interesting,and thank you for your introduction.I have yves saint laurent sunglassesa good shopping website,I'd like to introduce you, hope you like it!
report abuse
vote down
vote up
Votes: +0
worth a look
written by C***p n**e s***s , May 20, 2011
wholesale christian audigier jeans
christian audigier Short jeans
report abuse
vote down
vote up
Votes: +0
Newest Jordan 26
written by waytowholesale , May 23, 2011
Newest Jordan 26

http://www.waytowholesales.com/product_list-Jordan-26-c___867.html

Payment: Paypal, Western Union, Money Gram, T/T.
Delivery time: 5-7 days
Accept Wholesale , Dropshipping, Retail Order. , the more quantity you order and the lower price you get .
For more new selection ,

Please check in : http://www.waytowholesale.com

report abuse
vote down
vote up
Votes: +0
air jordan s***s for kids
written by authentic air jordan s***s , July 05, 2011
Open the workflow builder and attach these attributes to Workflow Notification Message, by dragging these attributes to the workflow message in workflow builder
report abuse
vote down
vote up
Votes: +0
http://www.kevils.com
written by Herve Leger d***ses , July 11, 2011
smilies/grin.gif smilies/grin.gif smilies/grin.gif smilies/grin.gif smilies/grin.gif
report abuse
vote down
vote up
Votes: +0
Consultant
written by Tarun , September 21, 2011
Man you are a genius, u saved me, all day I was trying to implement this and here you have the complete solution. Thanks dude and please keep up the gud work of serving the community. You have a self less quality which less people have these days.
report abuse
vote down
vote up
Votes: +0
Error E
written by krsrasu , October 17, 2011
Hi Anil

I have faced the following error in the quality notification workflow. what could be the reason and how to debug?
Approval workflow failed due to the following error message

Error :E ; Cannot fetch xxx results - Unable to fetch the xxx details

please help

rgds
krsrasu

report abuse
vote down
vote up
Votes: +0
http://coachonoutletfactory.com/
written by coach factory , October 27, 2011
Produced from black leather and layed out with silver metal hardware and studs, this Coach Madison Bags has additional something than an regular black bag. The shoulder straps are attached towards the bag by rings, along with the bag shuts obtaining a drawstring top. I kinda such as this bag- it’s a little Coach Poppy Bags but nonetheless chic and practical.
——————FROM:QL
report abuse
vote down
vote up
Votes: +0
http://storagemax1.com/
written by storage website , October 27, 2011
These ingredients could be neatly stored in racks behind cupboard doors.
report abuse
vote down
vote up
Votes: +0
How to get the ItemKey for a Workflow triggered by an event in Oracle Apps 11i
written by smita , November 03, 2011
Hello,
I have added a custom sub process to the seeded "OM Order Header" workflow. The process sends a notification. There are a few attributes in the body of the message tied to this notification, to which I am trying to assign values to using the syntax:
SetItemAttrText (itemtype, itemkey, attrname, attrvalue).
I have the internal names for the item type and attribute name, but don't know how to get the value for the item key. I understand the item key is supposed to be unique for each item type and is automatically generated by the workflow engine when the work flow fires. Is there a built-in function or some means to get this value?
Regards,
Smita
report abuse
vote down
vote up
Votes: +0
Thank you
written by Akram , March 25, 2012
Thank you
report abuse
vote down
vote up
Votes: +0
How to check the mails sent from workflow.
written by Mamta , April 05, 2012
Hi Anil,

I need to know to whom all the mails sent by workflow in a day.Please assist if you have any idea.

Thanks,
mamatha
report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Saturday, 24 October 2009 12:45 )  

Search apps2fusion