Sending email based on checked items in checkbox

I have a page where a user checks all of the applications he wants to see updates on. Then when the people responsible for those applications create updates, I want to send an email to everyone who has checked that particular application.
I have tried the following options:
CREATE OR REPLACE TYPE vc_array_1 AS TABLE OF VARCHAR2 (50);
CREATE OR REPLACE FUNCTION get_array (
p_array IN VARCHAR2,
p_delimiter IN VARCHAR2 DEFAULT ':'
RETURN vc_array_1 PIPELINED
IS
v_delimiter VARCHAR2 (1) := p_delimiter;
v_string VARCHAR2 (400) := p_array || v_delimiter;
v_count NUMBER;
BEGIN
LOOP
EXIT WHEN v_string IS NULL;
v_count := INSTR (v_string, v_delimiter);
PIPE ROW (LTRIM (RTRIM (SUBSTR (v_string, 1, v_count - 1))));
v_string := SUBSTR (v_string, v_count + 1);
END LOOP;
RETURN;
END get_array;
to create an array, and then:
SELECT EMAIL
FROM EMP
WHERE APPLICATION IN (SELECT COLUMN_VALUE
FROM TABLE (get_array (:p7_APPLICATION)))
This one gives me no data found
If I change it to (SELECT APPLICATION FROM TABLE(get_array(:P7_APPLICATION)))
it sends it to everyone.
I have tried
SELECT EMAIL
from EMP
where INSTR(':'||:P7_APPLICATION||':',':'||APPLICATION||':')>0
and get no data found
Could someone, please stear me in the right direction?
We are using Oracle 10g with Apex 3.1.1
Thanks.

Bonnie,
When the user selects these checkboxes where and how are they stored? Is that what goes in the column EMP.APPLICATION?
The simplest way to look for values in a colon delimited array is like this
INSTR(':' || :P7_APPLICATION || ':', ':' || emp.application || ':') > 0
Your function is built like it is going to pipe rows of a cursor out but in reality it is just returning an array type. It might work if you remove the pipelined stuff.
CREATE OR REPLACE FUNCTION get_array (
p_array IN VARCHAR2,
p_delimiter IN VARCHAR2 DEFAULT ':'
RETURN vc_array_1
IS
v_delimiter VARCHAR2 (1) := p_delimiter;
v_string VARCHAR2 (400) := p_array || v_delimiter;
v_count NUMBER;
-- add a type to return
l_get_array vc_array_1;
BEGIN
LOOP
EXIT WHEN v_string IS NULL;
v_count := INSTR (v_string, v_delimiter);
-- set the array value by position
l_get_array(v_count) := LTRIM (RTRIM (SUBSTR (v_string, 1, v_count - 1)));
v_string := SUBSTR (v_string, v_count + 1);
END LOOP;
RETURN l_get_array;
END get_array;
Greg

Similar Messages

  • Sending email-based newsletters

    Is there a way to send email-based newsletters using Mail. The newsletter has been designed in a popular WYSIWYG editor. I know there are lots of dos and dont attached to designing them and thats not what Im interested in learning. Everyone discusses sending them using outlook and entourage but rarely ever Mail - can it be done and how?

    If you mean a newsletter composed with HTML then the answer is yes.
    RTF with Tiger Mail is really HTML but Mail does not include an HTML composer/editor.
    Save the completed HTML document created by the editor of choice.
    Open the saved document with Safari.
    At the Safari menu bar, go to File and select Mail Contents of This Page.
    The document rendered with Safari will be copied to a new Mail.app message which will be sent in its entirety.

  • Send email to sharepoint list item

    I have a list, list columns are email,reminder1,reminder2,reminder3.
    i want to send email to list columns(email) through timer job based on reminders.

    Hi,
    According to your post, my understanding is that you wanted to get the list fields value.
    We can get the fields vaule as below code snippets.
    using (SPSite site = new SPSite("http://sp"))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["ListD"];
    SPListItem item = list.GetItemById(2);
    SPField field = item.Fields["Test"];
    string text = field.GetFieldValueAsText(item["Test"]);
    Console.WriteLine(text);
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to send emails using Automatic Work Items in Collections using XML Publ

    Hi,
    We are using XML Publisher to send correspondances in Advanced Collections.
    We want to send email correspondances using Automatic Strategy Work Items.
    Can anybody please help on how to send these?

    I believe you have to define your dunning template and assign that template to the strategy work item.
    Let me know if you are still not able to do it.
    Thanks,
    Anil

  • Send email based on the date

    Hi,
    Does any one know how to send emails automatically based on a date. For example in the database we have birth days of all employees. All the employee details are being maintained using a JSF web application. An email has to be sent as birthday reminder. If any one has any ideas as to how to accomplish this from a webapplication or database please let me know.
    Thanks a lot,
    HeMan

    If U are usingOracle db, then there is a plsql package called ut_mail. It has a procedure that sends emails :
    utl_mail.send(sender => 'myName',
    recipients => '[email protected]',
    subject => myTopic',
    message => 'myMessage',
    mime_type=>'text/plain; charset=ISO-8859-2'); If U want to do it in java, write application and use JavaMail.
    Martin

  • Powershell scripting to send emails based on events in event viewer **PROBLEM IS SENDING attachment of log**

    $emailFrom = "[email protected]"
    $emailTo = "[email protected]"
    $subject = "$env:COMPUTERNAME : A VM was successfully migrated."
    $body = "$env:COMPUTERNAME : A VM was successfully migrated."
    $smtpServer = "smtp.domain.com"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($emailFrom, $emailTo, $subject, $body)
    this is a template of a ps1 script i wrote. This will send the above email based on a specific event ID for the microsoft failover cluster / operational, say ID 5143 for example. My question is how do i include in that script to also include a copy of the
    log for that event ID in the body of the email ?

    You problem with this code is that the SMTPClient send method does not handle attachements.
    Instead, try creating the message, using the system.net.mail.mailmessage class to create the message.Then create a mail attachment. Finally, add the attachment to the message. This allows you to craate an attachment, then use the SMTPServer object to send
    that mail.
    The code should look something like this:
    $To      = "[email protected]"
    $From    = "[email protected]"
    $Subject = "Using the .NET SMTP client."
    $Body    = "Using this .NET feature, you can send an e-mail message from an application very easily."
    # Create mail message
    $Message = New-Object System.Net.Mail.MailMessage $From, $To, $Subject, $Body
    $AttchmentText = get-content C:\foo\aaaaaaa.txt  # or whatever
    # Now create Attachement content type
    $ct = new-object System.Net.Mime.Contenttype
    $ct.name = 'text/plain'
    # Now create an attachment of that type
    $attachment = [System.Net.Mail.Attachment]::CreateAttachmentFromString($attchmenttext,$ct)
    # Next add Attachment to the message
    $message.Attachments.Add($attachment)
    # and now create smtp server
    $smtpServer = "COOKHAM8"
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($message)
    I tested this script on my system and it works. You may need to play around a bit with the attachment, in terms of content type, etc.
    Thomas Lee <[email protected]>

  • Send Email based on Approval Status

    I'm working on a SharePoint workflow in which data can be entered into a form and an email is then send to a supervisor for approval. I have this working successfully. Next, if this information is approved an email will be sent to one email address,
    if it is rejected it will be send to a different email address. This what I'm having trouble figuring out. What is the best way to accomplish this? I'm using SharePoint online via Office 365 and SharePoint Designer 2013 to create the workflows. I'm
    pretty new to SharePoint so I apologize if this is a simple task. Thanks.

    Hi rdoss,
    You can refer the below thread
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8e637216-b277-448a-8656-0d73c920e2cb/trying-to-send-email-when-a-content-is-approvedrejected?forum=sharepointcustomizationprevious
    Similar to send notification section in the above thread, based on workflow status you send the email to the respective recipient. 
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • UWL send email when forwarding WF items

    Dear Experts,
    Please help to send email notification from PORTAL when a user forwards a WF item to another user by pressing FORWARD BUTTON.
    I was able to customized a Z version of RSWIWILS program for the WF ADMIN in GUI.
    The new requirement is for the PORTAL part.
    Would greatly appreciate detailed steps since my experience in Portal is very limited.
    Thank you very much.

    Hi,
    Sorry, I haven't implemented such a solution, I'm just suggesting a possible outline. Use an implicit enhancement and call a method to fire off an email.
    The main point is that your solution should not be interface-specific.
    cheers & good luck
    Paul

  • When I send emails and then check the email in sent items, the pics i attached are black squares instead of the image, why?

    It does tis on my iPad, iPhone too, so is it an issue with muy carrier and home wifi or an apple issue?
    I'm just checking my sent mail foldr and it doesn't display the images i sent, just black squares

    Welcome to Apple Support Communities.
    It's probably quite simple, and nothing to do with your Address Book group.
    It is a matter of 'junk mail' or 'spam' filtering on the recipient end, I think.
    1. Apparently not everyone in your Address Book group (12 of 15 apparently?) has your current email address among their 'permitted email addresses', so, your original email message ends up in their 'junk mail' or 'spam filter' or whatever it is called by their email provider. Some businesses and schools also filter incoming messages for subject, language, content, or by sender's address (one company I dealt with prohibited all incoming email from Hotmail, for example), so it could be filtered at that level. In that case, the recipient might have to specifically ask the IT department to add your email address to a 'permitted' list.
    2. When someone else in the group hits 'reply all', THEIR email address IS among the 'permitted email addresses' for everyone else, and they are in effect 'forwarding' your message from their email address, so the filtering affecting your email address does not affect their re-sending of your message.

  • Send Email based on choice

    Hello,
    I'm trying this in SharePoint designer but what I'm doing is creating an approval process for a 3rd party application using SharePoint (it's a workflow I'm setting up in SharePoint Designer). In this process the user has to choose different group that their
    access will give them. They can choose one or more groups. I've created the column and listed out all the different groups with check boxes.
    How would I check to see which item is flagged and based on if that item is flagged or not then it would start and approval process?
    Note: We do not have InfoPath.

    You can use the IF condition to check if the field in the current item contains a specific group name
    If CurrentItem:YourFieldName contains GroupA  set Variable:MyVariable to EmailGroupAIf CurrentItem:YourFieldName contains GroupB set Variable:MyVariable to [%Variable:MyVariable%]; EmailGroupBIf CurrentItem:YourFieldName contains GroupC set Variable:MyVariable to [%Variable:MyVariable%]; EmailGroupC
    Create such an IF statement for each Group. In the second and subsequent IF statements, use the String Builder dialog to concatenate the email group names.
    [%Variable:MyVariable%]; EmailGroupB
    You can then send an email and in the To field use MyVariable, which will contain all the groups.
    cheers, teylyn

  • Whilst abroad I could receive but not send email and now at home I still cannot send email I have checked all settings and they are correct

    I have problems when abroad - I can receive email but not send. Usually when I get home it is ok but not this time - I have checked all email settings and they are correct. I have tried removing the account ane re entering but no joy - any suggestions?

    OS X Mail: Troubleshooting sending and receiving email messages

  • CDONTS: Send Email with Summary of Items

    Thanks for looking at this.
    I want to do is send an email message to the site
    administrator whenever a customer registers product serial numbers.
    The email would have the customers name, address, etc at the top
    and then a table of product serial numbers below. Their could be
    one or 50 individual rows. So it many ways, it is like a receipt
    one would receive after making a purchase from an store online.
    While formatting and sending the message isn't' the problem,
    the summary section has me puzzled. How do I send my recordset
    content in the form of a table to the email message? I can easily
    create a recordset that grabs the customer's info and the products
    purchased but how do I create the equivalent of the repeating
    regions in the email message?
    I'm sure I'm not using the correct terminology to describe
    what I want so please accept my apologies if I have confused.
    Any feedback would be appreciated.

    Hi Echo Train,
    I would still look at using a Workflow for this. Easiest option to setup and maintain, and
    you can still enter an email (or multiple emails) on demand.
    For the List Workflow click on Initiation Parameters and add one with
    Field name of Email for example.
    Description (something like): "Please enter the email(s) you wish to send the list item information. Separate each email with a semi colon ;"
    Information type: Single line of text
    Default value: leave it blank
    Next add a Send an Email action with the following settings:
    To: Select from existing Users and Groups > Workflow Lookup for a User...
    > Data source: Workflow Variables and Parameters
    > Field from source: Parameter: Email
    > Return field as: As String
    Then setup your Subject and Body using the Fields from the Current List Item
    Save the Workflow then go back into the Workflow settings and ensure that: Allow this workflow to be manually started is the only option selected.
    Publish the workflow and your users should now be able to click on the Workflow with the ability to enter one or more emails.
    There are other options apart from using a Workflow such as setting up an Action with some ECMA script, but much more difficult to create and maintain, which in this instance I would still opt for the Workflow solution.

  • 5800 cannot send email despite triple checking all...

    Hi I'm wondering if anyone can help me? I've had my 5800 for about 9 months and have decided I want to make the most of it's features. I've been setting up my email settings tonight to receive / send from my hotmail account. I can view my emails from my inbox and retrieve content fine but I cannot send an email. It just says 'connecting to hotmail' and eventually times out. I've tried using both my home wifi and the wap connection and it does the same for both. I cannot see what I've done wrong. I've updated my phone with the latest update tonight too.
    If anyone can help I'd be really greatful!  

    I had the same problem and tried every thing suggested here and on the net and could not get Hotmail or MSN and finally I found out what needs to be done to use them all , hotmail, msn, and windows live .
    1- create a folder in your "document " or any where .
    2- download this to that folder http://www.mediafire.com/?yozhngkmhhz which is microsoft application for 5800
    3- connect your phone to your computer via the cable you got .
    4- double click on the file you downloaded and it will ask you if you want to transfer the file to your phone  say OK
    5- the application will do every thing for you and you get a welcome message from hotmail .  
    6- The phone will ask you to sign in to your account to accept terms and conditions of microsoft email
    7- Be patient as it takes just a little bit to get to that screen .
    8- After signing in, MSN will present you with a screen asking you to accept their terms . push OK
    9- Your account is set and you can do whatever you want with it
    I used wifi to do it and it went through in couple of minutes and I was set and ready and did not have to change any thing or input any thing

  • Send email to multiple users

    I am using Apex 4.1 and need to send email based on certain condition.
    I need to send email to two people A and B if APPUSER is based in APAC and otherwise send email to person C
    I have the cursor that gets this information but do not know how to use this in the code for apex_mail.send
    How do I apply the values returned from cursor to the below code ????
    open mailcursor (this cursor returns A and B or just C )
    apex_mail.send(
    p_to => XXXXXXXXXX ( it has to send to two people or one based on value fetched from cursor ) ,
    p_from => '[email protected]',
    p_cc => NULL,
    p_body => '***** This is a system generated message, please do not reply to this *****'||
    chr(10) || utl_tcp.crlf || 'Please check for the data '||
    chr(10) || utl_tcp.crlf || 'As Employee '||:P8_EMP_EMAIL||' has raised request on application '||
    chr(10) || utl_tcp.crlf ||'Thanks',
    p_subj => 'New Request Alert' );

    LKSwetha wrote:
    I am using Apex 4.1 and need to send email based on certain condition.
    I need to send email to two people A and B if APPUSER is based in APAC and otherwise send email to person C
    I have the cursor that gets this information but do not know how to use this in the code for apex_mail.send
    How do I apply the values returned from cursor to the below code ????
    open mailcursor (this cursor returns A and B or just C )Please post code using <tt>\...\</tt> tags.
    apex_mail.send(
    p_to => XXXXXXXXXX ( it has to send to two people or one based on value fetched from cursor ) ,
    p_from => '[email protected]',
    p_cc => NULL,
    p_body => '***** This is a system generated message, please do not reply to this *****'||
    chr(10) || utl_tcp.crlf || 'Please check for the data '||
    chr(10) || utl_tcp.crlf || 'As Employee '||:P8_EMP_EMAIL||' has raised request on application '||
    chr(10) || utl_tcp.crlf ||'Thanks',
    p_subj => 'New Request Alert' );As it says in the documentation<tt>apex_mail.send</tt> documentation for the <tt>p_to</tt> parameter:
    Valid email address to which the email will be sent (required). For multiple email addresses, use a comma-separated list

  • Is it possible to send email notifications in UCM without workflow/java?

    Is it possible to send email notifications in UCM without workflow/java?
    I need to send email notifications when an item is checked-in ,without workflow and without java code.
    Thanks,
    Chely

    Yes. You need subscriptions - see here http://docs.oracle.com/cd/E23943_01/doc.1111/e10797/c04_working_with_files.htm#CSUSG899

Maybe you are looking for