System_Mail_Send - Get user email address

Hi,
I am trying to use System_Mail_Send to send a notification in the end of a Job Chain.
How I can retrieve user email address from SAP CPS user(UME)?
I want to use this information as To destination.
Regards,
André Ferreira

Hi Andre,
Actually, I had no time to test what I wrote earlier ... the code below should work in a library source:
// Example code to illustrate
package masalan;
import com.redwood.scheduler.api.model.SchedulerSession;
import com.redwood.scheduler.api.model.Subject;
import com.redwood.scheduler.api.model.enumeration.SubjectType;
import com.redwood.scheduler.api.scripting.variables.*;
public class user
public static String getEmailAddress(String username)
     //Default email address is [email protected]
      String defaultEmail = "[email protected]";
      if (username == null || username.trim().isEmpty()) return defaultEmail;
      SchedulerSession jcsSession = ScriptSessionFactory.getSession();
      Subject subject = jcsSession.getSubjectByTypeName(SubjectType.User,  username);
      String email = "";
      if (subject != null) email = subject.getEmail();
      if (email != null && email.endsWith("@company.com")) return email;
      return defaultEmail;
You create REL entry points:
Name - getEmail
FQ Class Name - masalan.user
Method Signature - getEmailAddress(String)
Now, create a parameter Username on the job chain.
Parameter To should have  the value =Custom.getEmail(chainParameters.Username)
You specify the username in the Username parameter, the email address will be retrieved from CPS. The user must have logged on to CPS at least once, alternatively, you can import the user.
Note that to import the user, you must assign at the very least the AccessScheduler action in UME.
Regards,
HP
Message was edited by: h. Carpenter - missed an import and add SchedulerSession
Message was edited by: h. Carpenter - Improved error handling, more secure code (it uses default email address if anything goes wrong or if somebody tries to use an external email address)

Similar Messages

  • Realm - get user email address

    I've successfully connected to realm and returned the user groups, now im trying to return some extra details about the user such as their email address.
    I can return the roles of the user by setting
    userRoleName="memberOf"
    and I can get the email address by setting
    userRoleName="mail"
    But I dont seem to be able to return both. Im totally lost on this so any help is much appreciated. All I need is a pointer in the right direction.
    Many Thanks in advance

    no problem :)
                             <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
                                  connectionURL="ldap://xxxx/"
                                  connectionName="xxx"
                                  connectionPassword="xxx"
                                  userBase="OU=xxx,DC=xxx,DC=xx,DC=com"
                                  userSearch="(sAMAccountName={0})"
                             userRoleName="memberOf"
                                  roleSubtree ="true"
                                  userSubtree="true"                         
                             />
    Like I said changing the userRoleName="memberOf" line to ="mail" does return the email address of the user instead

  • Email Button for Reply(Getting sender email address)

    Here is my scenario...
    User fill a form and then send it via an email button.
    Is it possible the receptian of the form to reply click on an email button to the sender?
    The Reply email button will get(with a script) always the value(Email address of the Sender).
    We are using Outlook.
    Thanks very much

    Hi,
    To be honest, I think that a visible field for the user to input their email address is going to be the best way.
    Acrobat has a property called 'identity' in the Edit > Preferences menu, which contains user information, including email address. However this information only exists if the user has manually typed this into the preferences.
    You can access the identify properties using a trusted function, however this can be troublesome, because you need to distribute and install the javascript file into a specific folder on ALL of your user's computers.
    In addition if the user has not specified their email address in the preferences, you cannot get this data.
    Lastly, there appears to be an issue if the form is Reader Enabled in Acrobat. There is a discussion here: Keep user from printing and seeing certain pages
    All in all the trusted function is flaky and liable to failure. Outside of databases or some back end system, I can't see an easy to automatically harvest a users email address.
    Good luck,
    Niall

  • How do I get my email address recently changed on my account in iTunes on my MacBook Pro to show up on the sign-on notice on my iPad (4th gen)?

    How do I get my email address recently changed on my account in iTunes on my MacBook Pro to show up on the sign-on notice on my iPad (4th gen)?  It reflects my old email address and therefore won't recognize my password.  When I try to do something on the App Store on my iPad, it brings up a notice to sign on, which reflects the old email address, and rejects my password since the username/email address is no longer correct.  Puzzled!

    I have another question for the community.  My daughter tells me that my texts to her show my primary email address as the account name of the sender (me) when I text her, rather than my cell phone number from which I'm texting her.  I've had others report that to me too. How do I turn that off so that recipients see my cell phone number displayed as the sending party and not my email address?  Thanks - 

  • How to get group email addresses in BCC on iPad?

    Have recently bought iPad mini, have MacBook so synced. Cannot get group email addresses to show up in iPad addresses book, and can't get them into bcc on mail?

    That is because groups cannot be added in the iPad mail app, as bizarre as that seems. That functionality does not exist. You cannot create groups in the contacts app on the iPad either. Yoy can create them in iCloud.com but not on the iPad itself. You just have to add the email addresses one at a time by tapping the blue + button and selecting the contact from the contacts window that will pop up.
    There are apps that let to email to groups .....
    MailShot
    https://itunes.apple.com/us/app/mailshot-group-email-done/id410279354?mt=8
    Group Email!
    https://itunes.apple.com/ca/app/group-email!-mail-client-attachments/id380690305 ?mt=8

  • I would like to change my user email address to a different email? I am currently subscribed with [delete] but would like to change it to [delete]

    I would like to change my user email address to a different email?
    I am currently subscribed with [email protected] but would like to change it to [email protected]

    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -email address https://forums.adobe.com/thread/1446019

  • Outlook Add-In Mail Item Address How to get the email address for Receipents & Sender?

    Hello,
    I am developing an outlook add-in and unable to retrieve the email address from the To,CC,BCC field & the "Sender".
    I have written the below code - 
    //Prepare list of receipients.
    List<string> emailIds = new List<string>();
    foreach (Outlook.Recipient recipient in mailItem.Recipients)
    { emailIds.Add(recipient.Address); }
    emailIds.Add(mailItem.SenderEmailAddress);
    In the code above, if the receipient/sender address is saved in the address book, I get the details else "null".
    Could someone please help me in fetching the correct email address irrespective of it been saved in the address book or not?
    Thanks!
    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or
    "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

    Hello Starain,
    I am sorry but I do not understand why this is happening as I get proper results.
    Coming to the recipient from the address book, I just want to re-confirm what we mean by "recipient
    from the address book". By this, I mean that whether my recipient is a contact in the outlook address book or not, I get proper email address.
    Please confirm are we on the same page? As other than this, I do not see any difference.
    Thanks!
    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or
    "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

  • TS2755 I have just updated my phone to iso 7 on my wifes i tunes on her computer, now when i send a message to people they get my email address come up and when i need to update it askes for her apple id.. any help please

    I have just updated my iphone to iso 7.0.2 on my wifes i tunes on her computer,now when i send a message to people they get my email address come up and when i need to update apps it asks for her apple id... any help please????

    ChrisJ4203,
    Thank you for the help.  Every app on my phone was downloaded using my old I-tunes ID.  I just hope that they will re-download under my new ID because I still can't change it on my phone.  In order to change to the new ID it says I have to sign out from the old ID and change to the new one.  My problem is that I don't remember my password to be able to sign out from my old ID.  Then the phone says it can change my password through e-mail and I  agree but I never get an e-mail at my old address or the new one.
    BHuyett

  • Cannot get website email address from clicking Contacts Help

    Hi
    A lot of websites I go to and click on Contact us or email us nothing happens and therefore I cannot find the email address ,
    I have found a Way around that is plug in my Mouse and right click properties and sometimes I get the email address ,
    However this is annoying as happens alot .. Yes pop up window is turned off so if pop up should work
    any help fixing would be great ..
    example of webpage below
    http://www.capebyronimports.com.au/location.htm
    I click on there contacts email address and it just flashes but never see address
    How can I see the email address - is there some setting wrong somewhere ??
    thanks all

    Hi Globalmark,
    How can I see the email address - is there some setting wrong somewhere ??
    The email address should appear in the Status bar at the bottom of the Safari window when you mouse over the address. If there is no Status bar there, press cmd+/ to turn it on.
    Normally when you click on an address it should launch your local email application. Open Mail (Applications > Mail) and check in Mail preferences > General to see what application is currently configured to handle emails (don't ask me why this setting is here... only Apple can answer that one!).
    If it is set to Mail aready, try changing it to something else (any program, it does not matter which one) and then quit both Mail and Safari. Restart Mail, and once again change the default application to be Mail and quit Mail once more. Lastly, restart Safari and retry a site with an email link.
    Hope some of that helps!

  • I have been told my macbook does not have enough gb for Lion. and that i can not keep my mobile me mail without lion. so does this mean I have to drop mobile me and get another email address?

    I have been told my macbook does not have enough gb for Lion. and that i can not keep my mobile me mail without lion. so does this mean I have to drop mobile me and get another email address?

    You probably know that mobilme goes away in June this year. There are two ways to access your mail account on iCloud, either through Lion or via the web. Web access won't get you to all the benefits of iCloud but will allow you to get to Mail, Contacts, Calendar, and Find My iPhone.  See this FAQ: http://www.apple.com/mobileme/transition.html
    If you decide to go with Lion, the maximum memory you can install is 4GB, however the system will only use 3GB, which is enough to run Lion. Lion requires 2GB, however, some have not been satisfied with it's performance in 2GB. One source for memory is OWC at http://eshop.macsales.com/shop/memory/MacBook/DDR2/

  • WHAT CAN I DO TO GET THIS EMAIL ADDRESS INPUTED?

    SETTING UP AN IMAP EMAIL ON HP EPRINT. IT CONTINUES TO TELL ME VERIFICATION ERROR. I KNOW FOR A FACT THE INFORMATION IS CORRECT BECAUSE I HAVE SET THE EMAIL UP ON THE I PAD AND MY PHONE WITH NO PROBLEMS. WHAT CAN I DO TO GET THIS EMAIL ADDRESS INPUTED?

    Hi RIZZMAN1969,
    Welcome to the HP Support Forums. I gather that you are trying to enter your email credentials into the HP ePrint app and you are getting a verification error.
    I have included a link to a post by @VisionAiry that lists the information needed to add the more common email providers in the USA. If you continue to have problems please let me know who your email provider is so I can help you find the information needed.   Another option is to please call HP’s Cloud Services at 1-855-785-2777 if you live in the USA/Canada region. If you live outside the USA/Canada region please click here to find the Technical Support number for your country/region.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Customise EOP Spam Notification End-User email address and email content

    Hi
    We are using EOP with our on-premise Exchange 2010 environment. 
    I am rolling out EOP and have the following two (simple) questions, regarding the Spam Notification email that is sent to end-users:
    1. Can we edit the email address that sends the Quarantine notification email? Or must the email come from [email protected]
    2. Can we customise the Quarantine email that is sent to the End-user (with our company logo)?
    From my experience and understanding, I believe the answer for both is NO, but my customer is adamant that editing the email address and customising the email content is possible.. Please advise.
    Thanks
    Ron

    The safelist/blocklist is tied to one email address. However, if you enable email alias consolidation done by LDAP and leveraging off of the Active Directory, then you may be able to achieve what you want.
    The safelist/blocklist comes into play with respect to anti-spam results. The email alias consolidation should occur much earlier.
    So, see if you can get email alias consolidation using LDAP/Active Directory working and it should address the safelist/blocklist thing.

  • Retrieve Users Email Address from Login

    Hi,
    I'm trying to get the users e-mail address from the login providers (EG. MS, Google, Facebook and Twitter) so that I can insert it into the database on the Mobile Services side. I have gone through various articles about getting their full name etc, but
    there is no mention of email address?
    I need it as I need a way to send emails back to the user. Is this possible and if so how?
    Thanks very much
    Regards,
    Mauro

    This is similar to the blog post Rafal points to but more aggregated. However you might not be able to receive the email as ip's might not provide that info. (Please mark this as aswereed if you find it usefull)
    exports.get = function(request, response) {
    var user = request.user;
    var identities = user.getIdentities();
    var url;
    var req = require('request');
    var provider;
    if (identities.google) {
    provider = "Google";
    var googleAccessToken = identities.google.accessToken;
    url = 'https://www.googleapis.com/oauth2/v1/userinfo?access_token=' + googleAccessToken;
    } else if (identities.facebook) {
    provider = "Facebook";
    var fbAccessToken = identities.facebook.accessToken;
    url = 'https://graph.facebook.com/me?access_token=' + fbAccessToken;
    } else if (identities.microsoft) {
    provider = "Microsoft";
    var liveAccessToken = identities.microsoft.accessToken;
    url = 'https://apis.live.net/v5.0/me/?method=GET&access_token=' + liveAccessToken;
    } else if (identities.twitter) {
    provider = "Twitter";
    var userId = user.userId;
    var twitterId = userId.substring(userId.indexOf(':') + 1);
    url = 'https://api.twitter.com/users/' + twitterId;
    req(url, function (err, resp, body) {
    if (err || resp.statusCode !== 200) {
    console.error('Error sending data to FB Graph API: ', err);
    request.respond(statusCodes.INTERNAL_SERVER_ERROR, body);
    } else {
    try {
    var userData = JSON.parse(body);
    if (identities.google) {
    user = {
    firstname: userData.given_name,
    lastname: userData.family_name,
    gender: userData.gender,
    username:userData.username,
    fullname:userData.name,
    picture:userData.picture
    } else if (identities.facebook) {
    user = {
    firstname: userData.first_name,
    lastname: userData.last_name,
    gender: userData.gender,
    username:userData.username,
    fullname:userData.name,
    picture:userData.picture
    } else if (identities.microsoft) {
    user = {
    firstname: userData.given_name,
    lastname: userData.family_name,
    gender: userData.gender,
    username:userData.username,
    fullname:userData.name,
    picture:userData.picture
    } else if (identities.twitter) {
    user = {
    firstname: userData.given_name,
    lastname: userData.family_name,
    gender: userData.gender,
    username:userData.username,
    fullname:userData.name,
    picture:userData.picture
    else{
    request.respond(statusCodes.INTERNAL_SERVER_ERROR, "Provider not supported");
    response.send(200, user);
    } catch (ex) {
    console.error('Error parsing response from '+provider+':', ex);
    request.respond(statusCodes.INTERNAL_SERVER_ERROR, ex);
    If this answers your question, please use the "Answer" button to say so... Mikael - http://blogical.se/blogs/mikael

  • Help! GW altering CC'd external User email address.

    I have external Internet users created per TID 10099059. All that
    works well (we see them in our system book and can email them fine)
    until some one emails an internal user and has one (or more) of the
    users in the external domain CC'd. When the user replies-to-all, the
    external user's name now contains the GW domain and PO in it which, of
    course is invalid and gets bounced.
    Example:
    Object ID tomw
    external GW domain name= ANZ
    external GW po name= NZ
    last name= willow
    Given Name= tom
    internet domain= domain.co.nz
    email address= [email protected]
    When anyone is sent an email with [email protected] cc'd and
    then selects reply to all, his email address is "changed" by GW to
    [email protected] Of course this is promply returned because
    domain.co.nz has no record of [email protected]
    System specs GW 7.02HP running on OES Netware 6.5.6

    On Thu, 09 Jul 2009 18:55:13 GMT, Michael Bell
    <[email protected]> wrote:
    >Jim wrote:
    >> On Thu, 09 Jul 2009 17:29:16 GMT, Michael Bell
    >> <[email protected]> wrote:
    >>
    >>> Jim wrote:
    >>>> On Thu, 09 Jul 2009 15:08:27 GMT, Michael Bell
    >>>> <[email protected]> wrote:
    >>>>
    >>>>> Jim wrote:
    >>>>>> I have external Internet users created per TID 10099059. All that
    >>>>>> works well (we see them in our system book and can email them fine)
    >>>>>> until some one emails an internal user and has one (or more) of the
    >>>>>> users in the external domain CC'd. When the user replies-to-all, the
    >>>>>> external user's name now contains the GW domain and PO in it which, of
    >>>>>> course is invalid and gets bounced.
    >>>>>>
    >>>>>> Example:
    >>>>>> Object ID tomw
    >>>>>> external GW domain name= ANZ
    >>>>>> external GW po name= NZ
    >>>>>> last name= willow
    >>>>>> Given Name= tom
    >>>>>>
    >>>>>> internet domain= domain.co.nz
    >>>>>> email address= [email protected]
    >>>>>>
    >>>>>>
    >>>>>> When anyone is sent an email with [email protected] cc'd and
    >>>>>> then selects reply to all, his email address is "changed" by GW to
    >>>>>>
    >>>>>> [email protected]. Of course this is promply returned because
    >>>>>> domain.co.nz has no record of [email protected].
    >>>>>>
    >>>>>> System specs GW 7.02HP running on OES Netware 6.5.6
    >>>>> Do you have internet addressing enabled? And are using that to define
    >>>>> the internet domain?
    >>>> It is for ourdomain.com but there is not an entry for the
    >>>> domain.co.nz..should it be?
    >>> I mean under the external po.
    >>
    >> Under the External PO--properties--Groupwise--Internet Addressing, I
    >> have the 1st override checkbox checked and the Preferred address set
    >> to: first name.last name@Internet domain name. Also, the end override
    >> Checkbox is checked with the Internet Domain Name set to domain.co.nz.
    >>
    >>
    >Take a look at TID 3230787 which i wrote years ago. Most of it is the
    >same, but let's double check. Also note the workaround listed at the end
    >- instead of internet addressing, an alias can be used, although we try
    >to avoid those these days.
    I followed your tid. I noticed your note at the bottom is the exact
    issue I am having. I believe I have it configured as you say. Is
    there a way I can check the actual config file to make sure the change
    really is there? I would be glad to send a pdf'd screen shot of the
    area. Thanks.

  • OIM 11g: How to remove rule requiring unique user email addresses

    Use the OIM 11g Administrative and User Console to update a user's email address to be the same as another user's address and on save you get error message:
    "The user with the attribute Email and value [email protected] already exists"
    In OIM 9.1 we used to be allowed duplicate email addresses.
    OIM 11g wants them to be unique (refer OIM 11g User Guide table 11-2 in section "11.2 User Entity Definition" which shows the email attribute properties with unique:yes).
    How do you change this to "unique:no"?
    The OIM 11g Admin Guide section "14 Configuring User Attributes" describes the User.xml file in MDS but doesn't mention unique properties.
    The System Properties accessed via System Management->System Configuration doesn't show anything that looks like an option to enforce email address uniqueness.
    Thanks

    OIM 11g does not allow duplicate email addresses. We asked Oracle about this and they responded that the feature (duplicate email addresses) was "removed from OIM 11g due to sending mail notifications, security and other related
    concerns". We think we can live with this restriction and did not make an enhancement request.
    The user guide does show that email address is unique:
    http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14316/usr_mangmnt.htm#BGBDCDCH
    but there's no way to override the rule.

Maybe you are looking for

  • How to stretch content div to bottom of page.

    Been messing around with my site so much that I needed to create a new one. However, I can't get to stretch the content div to the bottom of the page if the content text doesn't fill the page. I have a footer at the bottom of the page that stretches

  • Substing !

    Hi guys. I am bit struct need bit help in the below query... I have one barcode something like this...'11064626|04549580|04549580-0004|NWR|000027.535' now i have to slipt the above information using the query using the pipe character... x=11064626 y=

  • Calling WD within a report

    Hi, I have a made a report that shows data in ALV and that is fine as it is. However, I now want to enhance the report with an option to show the data in a WD View. I would like to make it optional to the user; either they use the ALV Grid output or

  • Try to add new View object to an exist AM

    Dears , i'm trying to create new text filed in an exist OAF page and i have create anew vo and add it to the exist AM the below erroe has been appeared Message not found. Application: FND, Message Name: FND_VIEWOBJECT_NOT_FOUND. Tokens: VONAME = XxTe

  • I am unable to update my Ipad on my PC, network connection timed out

    Every time I try to update my IPad on my Laptop with Windows Vista, I get a message stating there was a problem downloading the software because the network connection timed out?