Conditional email

Hi,
I am trying to use the OdiSendMail tool with a conditional piece of code to change the content of the email depending on whether there were errors in the previous step. I have written the following piece of code:
<% if (odiRef.getPrevStepLog("ERROR_COUNT")=="0"){ %>
OdiSendMail "-MAILHOST=mail.server.com" "[email protected]" "-SUBJECT=Test Success Email" "[email protected]"
<%=odiRef.getPrevStepLog( "STEP_NAME" )%> completed successfully.
Start: <%=odiRef.getPrevStepLog( "BEGIN" )%>
End: <%=odiRef.getPrevStepLog( "END" )%>
Duration: <%=odiRef.getPrevStepLog( "DURATION" )%>s
<% } else { %>
OdiSendMail "-MAILHOST=mail.server.com" "[email protected]" "-SUBJECT=Failure Email" "[email protected]"
<%=odiRef.getPrevStepLog( "STEP_NAME" )%> completed with <%=odiRef.getPrevStepLog( "ERROR_COUNT" )%> errors.
Start: <%=odiRef.getPrevStepLog( "BEGIN" )%>
End: <%=odiRef.getPrevStepLog( "END" )%>
Duration: <%=odiRef.getPrevStepLog( "DURATION" )%>s
<%}%>
When I execute this, it appears to be falling into the ELSE category every time, regardless of whether there were errors or not. Does anyone know if what I am trying to do is possible, and if so, is there something wrong with my code above?
Thanks.
Edited by: _Phil on Aug 1, 2011 5:10 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Thanks for the responses Guru. OK, so I tried the procedure this morning but I'm getting the following error. It looks like the code isn't treating each OdiSendMail statement separately within the IF/ELSE block but rather merging them together:
ODI-1228: Task email_test (Procedure) fails on the target SUNOPSIS_ENGINE connection SUNOPSIS_MEMORY_ENGINE.
Caused By: java.sql.SQLException: Unexpected token: ODISENDMAIL in statement [OdiSendMail]
     at org.hsqldb.jdbc.jdbcUtil.throwError(Unknown Source)
     at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
     at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
     at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
     at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
     at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
     at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
     at java.lang.Thread.run(Thread.java:662)

Similar Messages

  • Conditional email notifications

    Is there a way to conditionally email or "check this box" to email given address or addresses? This feature would be great in my situation because I may be the creator of the form but others would benefit from specific submissions of collected data. I know I can make them co-authors and such, but they do not want to see every bit of data, just the stuff the pertains to them.

    We currently don't support this. You can submit a feature request here so others can vote on it:
    http://forums.adobe.com/community/formscentral?view=idea&ideaView=5515
    We use this to help prioritize our work.
    Randy

  • How to send a conditional email with interactive report subscription

    Hi,
    i have an interactive report with subscription.
    I would like to send an email with the attachment only when the query returns one or more records.
    How to to this?
    Apex 4.0.2
    Thanks in advance
    lukx

    Well, to understand your requirements can I ask this:
    You said earlier you want a report sent whenever records that meet a criteria exist, correct? So you want the application to query for a condition, and when that condition occurs (a row with primary Key = X, a select COUNT(1) for rows with column X returns a result of 1 or more)
    Then you would schedule a batch job:
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Send_Email_Procedure',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Test_For_COND_SEND(); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=hourly; byminute=0',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    This would in theory run hourly and run your test_for_cond_Send process, in which you would test for the condition and send an e-mail if it was found that would contain the results from your query/report.
    Here is a link to generate a PDF report that could be sent via e-mail: Re: how to save pdf in APEX 3.0
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • Conditional email polling

    Hello everyone!
    I wonder if it is possible to poll an email inbox conditionally (with OSB 11gR1)...
    For example, I want to poll only the emails coming from a certain sender... Or only the emails that include a certain substring in its subject...
    The purpose is to have several proxy services polling the same inbox, and depending on their properties invoke different services...
    If an email arrives to the inbox and does not fulfill any of these conditions, it remains in the inbox.
    Is this possible?
    Best regards,
    Bagagem

    Hello,
    I've been struggling with this for the past few days, I can't find a reasonable way to fulfill my needs...
    At the moment I have only one proxy service polling an email inbox through IMAP, and then, after reading the email, moves it to another folder inside the email (Post read action: Move; IMAP move folder: DestinationFolder ).
    However, if I have more than one service polling the same inbox... I cannot distinguish which emails are intended for which service...!
    I'm using OSB 11gR1.
    Any thoughts about this?
    Haven't anybody been working with something similar?
    Bagagem

  • Conditional EMAIL Subscription

    Hi
    I want to do a conditional Subscription of Email.i.e when certain condition happens i want to send the Email to a particular person.

    Robertson,
    1. Create a hidden item on you page.
    2. Create a page computation that sets the value of this item. I don;t know if the "conditions" you refer to can be determined solely within the context of the application so; this will determine which type of computation you will be creating. For example, if you need to check values in the database, you might pick "PL/SQL Function Body"
    3. Create a page process of type PL/SQL. Make sure the Point is set to after computations and validations. Within this, add PL/SQL to send the email. For example:
    DECLARE
    ls_EmailTo VARCHAR2(128);
    BEGIN
    ls_EmailTo := MyEmailAdressFinder;
    APEX_MAIL.SEND( p_to => ls_EmailTo,
    p_from => '[email protected]',
    p_body => 'Hi there, Robertson' );
    END;
    For the condition pick, "value of item/column in expression 1 = expresssion 2.
    This last part is important. In the expression 1 box, put the hidden item you created in step 1 above. In the expresssion 2 box, put the value that your computation would have set when you *do* want to send an email.
    -Joe
    Edited by: Joe Upshaw on Feb 15, 2012 1:49 PM

  • Sending an email using a scheduler

    Hi,
    I need a help to implement email scheduler.
    I need to notifiy a particular user using email.
    I am using JavaMail to send the email.
    All is working fine. I am able to send an email.
    Now, if under any conditions email notification fails, there should be a scheduler
    which should try to send an email within a time frame.
    Can you please help me to implement a scheduler?
    Thanks in advance!!!

    Normally that's the job of your mail server. If necessary,
    install a mail server on the same machine as your application
    to ensure that it's always available to accept messages from
    your application.

  • Notification Email should be triggered when hit the Apply changes?

    Hi All,
    Am creating a request form similiar to a remedy form,when ever the user create a new request and submit the request.Notification email will be sent to the user and the admin.
    Here when the admin ppl rejects the request,a notification email triggered to the user like request has been rejected .
    I have three radio buttons in the Form
    1.Submitted(default).
    2.Rejected.
    3.Accepted.
    When the admin edit the request and select rejected radio button,and apply changes ,a notification email should be triggered to the user.
    Now i have a after submit process for edit the ,which will be triggered when ever the user hit the apply changes button and it will send notification to both user and admin.
    How to achieve the notification email that should be triggered when the admin rejects the request and submit the form???
    am using apex version 4.0
    when the Admin will select the reject radio button and hit tha apply changes then the notification email should be sent to the user!!
    Always appreciate your help!!!
    Thanks & Regards,
    Ramya.

    Ramya wrote:
    Hi Gurujothi,
    Thanks for your response!.
    I can able to send email now.Thing is i need to send an email like when the admin rejects the request.
    For eg.
    1.Admin opened the request and select the Reject radio button and clicking Applychanges button then the email notification will be sent to the user like,
    Your request has been Rejected.
    2.If the Admin selects the radio button accept radio button and clicked apply changes,start processing about the request then the Email notification will be sent to the user like ,
    Your request has been modified .Request will be notified by the admin.(Working now)
    DO i need to create two separate process for the email notification like
    one is for all the modifications that the user/admin will do in the form ,once the record is created and another process is for Rejection purpose of the Form.But only one Apply changes button is there in the Form.You don't need two page process, In one single process you can acces the page item session values using *:YOUR_ITEM_NAME* bind variable syntax or V function like this V('YOUR_ITEM_NAME')
    So in your PL/SQL code you can easily prepare the email body based on your radio group item's value
    declare
    l_body varchar2(4000);
    begin
    IF :Px_MY_RADIO_GROUP ='R' THEN
      l_body := build your conditional email body for rejected
    ELSIF  :Px_MY_RADIO_GROUP ='A' THEN
      l_body := build your conditional email body approved
    END IF;
    apex_mail.send(
            p_to       => '[email protected]',   -- change to your email address
            p_from     => '[email protected]', -- change to a real senders email address
            p_body     => l_body,
            p_subj     => 'APEX_MAIL Package - Plain Text message');
    end;
    See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/concept_ses_val.htm#HTMDB03012

  • Mail Conditions not working in mail Form

    Hi all,
    Please kindly help me with the issue I faced.
    I created mail form with 2 Text elements. Each text element has condition from marketing attributes ( text element 1 - condition BPs are owners of freedges),  ( text element 2 - condition BPs are owners of ovens). In TCODE BP I assigned to my 2 BPs diffrenet marketing attributes, one is owner of oven, other is owner of freedge, but as a result after I runned test campaign I did not see in TCODE SOST that email were sent. But when I delete conditions email are being sent, but of course with two text element for each BP.
    What could possibly cause such issue?
    Thank you,
    Maria.

    Hi Maria,
    as far I know the application is designed a way, that once there is an empty email this will not be sent at all.
    Could you therefore first test the mail form - you can test it with a business partner with the mkt attributes assigned:
    If this gives an empty mail, with the text elements not available the issue is related to the conditions of the text fields. You then need to check the conditions.
    Alternatively you can try to add any text to the mail form that is displayed independently from the conditions - the mails should then be sent even for the business partners with mkt attributes assigned.
    best regards,
    Johannes

  • Attachments with email submission receipt?

    Based on response to check boxes, I would like to send an attachment with email submission receipt. The attached file would be condistional. For example, with response A, the submitter would get the attachment docA.pdf, with response B, the submitter would get the attachment docB.pdf, etc.
    Is this possible? Thank you.

    Sorry this is not possible. We don not support sending attachments with the email receipts. Also, you can't even have conditional email body message.
    Gen

  • Advanced Conditions

    I have a web form that sends an email to a user after successfully registering. Since this particular form allows empty email accounts, I have a condition that send them an email ONLY IF the email is not empty.
    Email Condition = {email}!= ""
    This works perfectly fine, but I now need another condition added. I do not want the auto email to send to anyone with an AOL address.
    I have tried: {email}!="" && {email} NOT LIKE "%@aol.com"
    (this is similar to what I would use in a standard SQL statement) but it does not work at all. It doesn't seem to accept the "NOT LIKE" statement. Obviously the "!=" will not work in the latter since it then looks for the wildcard symbol in the email :)
    Does anyone have any suggestions?

    Hi Sean,
    SQL like comparison parameters don´t work when PHP is supposed to examine a text string ({email}) for a given substring (aol), so you´ll need to help yourself with PHP´s stristr() - function: http://de.php.net/manual/en/function.stristr.php
    On that page you´ll find an "Example #2 Testing if a string is found or not", and I´d use this example in a modified form
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Pearl: can't figure out how to set up email...

    I purchased my Pearl about 2 wks ago, and haven't had any luck with email setup.  I previously had a bb for work, but that was managed through a work account.  I'm trying to view my local IP email via my bb, and not sure it can be done at this point.  This is probably pretty basic, but it's confounding for me so far.  Any help?

    Follow the below procedure to integrate your mail IDs-
    Click on the E-mail Settings icon. User will be prompted with BIS Terms and Condition
    On click of E-mail Settings user will be prompted with BIS Terms and Conditions
    User need to click Yes and also Agree on the mentioned Terms and Conditions
    Upon agreeing the Terms and Conditions Email Account Setup prompt will appear. From this part user will be able to integrate his/her existing email accounts
    For integrating existing email accounts type in the Email Address and Password as requested
    Upon clicking the Next button you’ll receive a notification of successful integration of BlackBerry. Click OK to finish the integration
    Right after successful Integration handheld will receive an email from Activation Server. This is an welcome notification for you
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Best Buy Willowbrook Store 214

    I purchased a 13" Macbook Pro from this store on January 26, 2013. The explained to the best buy employee that I wanted the 2 year warranty with the accidental damage protection, as this is the plan we get with all of our laptops. He agreed and I checked out. Upon leaving, I noticed the employee charged me for the 3 year plan, so I immediately went back to him and told him. He apologized and refunded me the cost for the 3 year plan and added the 2 year plan, and I assumed it was the same plan with the accidental damage protection except 1 year less. I never had to use my warranty until yesterday, after my laptop accidentally fell and shattered the screen and bent the shell. I went to the Best Buy in Humble, as it is the closest. They were very friendly and helpful, but at the end, the computer system asked for a payment. He took a look at my receipt and saw the plan was only the protection plan and not that ADH plan. He saw I originally was charged for the 3 year ADH, but then only given 2 year protection. He spoke to his manager and they told me to go to the store I originally purchased my laptop at and because they believe it was an employee error, the store should fix my laptop under their store warranty and cover my costs. 
    I then left the store and called the willowbrook store, as it is a drive and I didn't want to waste time driving there. I spoke to Bethany whom I explained my situation to and she then placed me on a few brief holds. She then told me that because my warranty was expiring in a 10 days, there was nothing they could do except charge me to fix my laptop. I asked why they could not fix my laptop under the store's warranty. She told me they could, but the charges incurred would be charged to me. I asked to speak to a manager and she told me she already spoke to 2 managers and that is what they told her. I again requested to speak to a manager. I was transferred to Spencer. Upon explaining the situation again, he told me there was nothing they could do. He said it could not be proven that the employee made a mistake, all he could go by is the receipt which says I purchased the 3 year ADH plan and then returned it and got the 2 year protection plan. I asked him if he discussed the plan he wanted with a sales rep and then saw he got something more and went back and got it exchanged, would he not assume he was getting the same plan but just one year less? He said yes he would, but as what is given to him, he can only see what I purchased and that his employee did not make a mistake. He told me he could not even prorate a refund because my warranty was expiring soon. I told him I was not looking for a refund and I was only trying to get my laptop repaired as I was told by the other store, could be done here. He told me that I signed off on the warranty and had the terms and conditions emailed to me so there was nothing more possible. I told him I did sign the warranty, which was for the 3 year plan, but when exchanging it, nothing was explained, nor was I asked for another signature. He said yes but again, you were given the terms and conditions. He also asked me why I did not question the big price difference between the two plans with only a year difference. I told him I was never given the prices or information, I only asked for what I wanted and when charged for something more, I went back and got it fixed (or so I assumed). I also told him I do not know what the prices are so I am not going to question the costs. He then told me that was all, he was not going to fix my laptop for me and with it only being 10 days away from expiring, there was nothing he was willing to do for me. 
    I was really upset by his service, he did not do anything to make the customer happy. I asked if there was a supervisor above him I could speak to and he said no they do not exist. I assured him that there had to be a district or regional manager I could speak to, if not then there was corporate as well. He said no there was not, nor was there a phone number or contact information he could give me. He told me he would give me corporate's number, but they did not handle these issues. I took the number any way and told him I'd give it a shot. That number was only the main number to set up appointments or purchase by phone. I still tried to reach a supervisor. I was transferred to different departments and call centers, but I patiently waited. Each person did not understand what I was trying to do, I only wanted to speak to a supervisor about my experience and how little help I was offered for a mistake by an employee. Each time, the agent on the phone went through my information and told me what kind of warranty I had. The second to last person I spoke to, Janelle, told me she would transfer me with the case ID number of {removed per forum guidelines}. She told me I did have ADH plan. I asked to confirm if it was the 2 year plan. She said yes it is the 2 year plan with ADH and expires on 01/31/2015 because I am given a grace period. She then transferred me to someone who asked for all the information again and put me on hold while he read the notes. He did not do anything with the case number. He then came back on the line and told me I was transferred to the wrong department and he would transfer me accordingly. I waited on the line for 10 minutes until the system told me the call could not be completed and to hang up. That was a total of 45 minutes to an hour gone to waste. I then tried to call the geek squad number to try to get a supervisor through them. I told the agent what I was calling for who then looked up my information and told me what plan I had. I told him that many people have told me that, I just want to speak to a supervisor. He said he would transfer me. He place the phone down, but did not put it on hold as I could hear other people talking. He then picked up and said the supervisor would get my call in a few minutes. He put the phone back down and I could hear people talking still. Finally he transferred me to where the call just kept ringing with no answer. I held on the phone for 5 more minutes as I was desperate to get this handled. Finally, after no one would pick up the other end, I hung up. 
    I am very frustrated and tired of going through different routes to get someone to help me. I am very upset and disappointed with the quality of service I was provided by the store and via the call centers. I would appreciate it greatly if someone could help me in my situation and contact me. 

    Hi Tbpatel,
    This sound like a terrible experience with us, and for that I truly am sorry. The Willowbrook store is correct that the damage to your MacBook is not covered unless your Geek Squad Protection (GSP) had Accidental Damage from Handling (ADH) coverage. Given these plans are underwritten by an insurance company we adhere strictly to the terms of the plan in question.
    I do have to be honest with you that going by your description of this the repair of this MacBook will most likely be at cost to you. I would like to look into this further into this and would truly appreciate it if you could send me a private message with your phone number, and your GSP number. To send me a private message click on the link in my signature.
    Thanks for posting,
    Allan|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

  • HT201304 Yes I got your e mail to agree the terms and there isn't know way for me to agree where do I agree at

    Why dosnt your e mail have a place for me to accept your terms and conditions

    User to user forum, no Apple here.
    We didn't send you anything.
    You agree to the terms and conditions in the pop up window where you had the terms and conditions emailed to you.

  • Send an E-mail notification Everytime a Control is Run in a Job

    Hi,
    What we need:
    We need the system to send e-mails every time a control is used in a job.
    Example:
    The job with the control is scheduled to run every morning and evening. When it's run in the morning, an e-mail should be sent to the control owners. When it's run in the evening, another e-mail should be sent to the control owners.
    The current status:
    Control owners are only getting an e-mail once per day. The messaging for the two jobs for a single control are being sent as one e-mail.
    Additional Details:
    Depending on the control, the user will get an e-mail notification either once per day, or everytime the job for the control is run. And some of these have to be run twice a day, or when the control owner requires it.
    It seems the two executions are being treated as a single work item, since they share the same control.
    Does someone have any information on what we can do? Or has someone done this before and can assist us?
    Best Regards,
    Raphael

    Hi,
    Don't know if still relevant but I had kind of similar PC business scenario. Way i solved it was to make control specific SM36 jobs (some having multiple control report steps in them).
    For most we have multiple control owners so in stcode SBWP i created email distribution lists and then in SM36 when defining the jobs I included those in the spool recipient list which will send out its data once the job was finished.
    Pretty much generic background job functionality but useful for PC as well. Now we are here on 10.1 SP6 and i could not find any other standard PC functions that quickly which do likewise.
    The above is OK for the moment with us but will not cater for more complex PC control sequences. I know that from within BRF+ you can also send out conditioned emails so that's where i'll focus on myself once time permits.
    All the best,
    George

  • IPhone 6 Technical Difficulty in Order Process

    Ok, so I pre-ordered the iPhone 6 64gb Space Gray on the 15th of September. My expected delivery was October 24th. Which I was completely fine with. Anyhow, today I get online to check the status, and it has given me a real order number (INSTEAD OF JUST THE PRE-ORDER NUMBER) but says there was a technical difficulty in the order process and to contact Verizon which I did by phone. I was on hold most of the time, which was completely ok with me, my Verizon rep, Priscilla was amazing, but she contacted several different people and even a person within a different department that could not give her a straight answer what the problem actually was. She said she would be calling me later this evening, hopefully with some good news about my order. I really hope it has shipped, but that is wishful thinking. I was just wondering if anyone else may have had this problem and if so what happened. I just hope my order is ok, she said that she had never seen that error before. Any help would be appreciated!

    I am having the same issue. I call and was given an order number that was 6 digits (is this right?) and when i try to check on the order it just says there are "technical difficulties, please try again later" I also ordered the six plus on the 15th, and went through the terms and conditions email, but i never received an order confirmation email. I just wanted to check on the order as i have heard that others are receiving phone alot earlier than the original posted delivery date. Now i am worried that my order was not processed correctly... as i have received nothing official to show i have an order processing. 

Maybe you are looking for