none
Sharepoint 2010 - workflow sending static email but not dynamic

    Întrebare

  • I am trying to send an email from a workflow in Sharepoint 2010.  If I use a static email address, everything works fine but if I specify "CurrentItem:CreatedBy" in the workflow nothing happens.

    I'm new to Sharepoint and I've been researching this for several days.  Any help would be appreciated.

    13 iunie 2012 16:20

Toate mesajele

  • When you specify the Workflow Lookup as

    Data Source: Current Item

    Field from source: Created By

    There should be a third drop down list that is "Return field as:". Do you have this as the default "as string" or do you have it as "Email Address"?

    13 iunie 2012 16:40
  • Please don't self propose answers, leave the community or the OP to do that for you.

    Returning the Created By field as an email address shouldn't matter, it's never made a difference for me.

    Have you checked that your workflow is triggering properly?


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

    13 iunie 2012 16:50
    Membru care oferă răspunsuri
  • Thanks for the advice Steven. I'm new to this so you'll have to forgive my poor etiquette.

    Jerry, there is also an option in the select users box that is "User who created current item". Have you tried using that?


    13 iunie 2012 16:56
  • Brandon, I tried it both ways and neither way worked.

    Steven, I'm not sure what you mean by "triggering properly".  I know the the workflow is finishing execution if I use a static email address and it does send the email for a static address.

    Is there way to debug this?  Or is there a log file somewhere?

    • Editat de Jerry444 13 iunie 2012 17:27
    13 iunie 2012 17:26
  • When you use a static email address, what do you use? Does it work if use domain/username (username@domain)? You could try checking the ULS logs, just guessing on that though.
    13 iunie 2012 18:42
  • When I use a static email address, I use username@domain.  Do I need to download a viewer to see the ULS logs?

    13 iunie 2012 18:47
  • Have you checked the Workflow history for a list item where the workflow has failed to send the email? One thing you could do that may help in figuring out what is wrong is by adding a 'Log to History List' action right before the 'Send Email' action in the workflow and for the message put "Trying to email [CurrentItem:CreatedBY]" and make sure you have the Return type set to "Email Address". Once you have added that action start a workflow and then when you view the workflow history for that item, it should show where it logged "Trying to email username@domain". If it doesn't show username@domain then please post what it says.

    As for ULS logs, I don't know much about that so I'm going to refer you to http://technet.microsoft.com/en-us/library/ff463595.aspx and maybe Steven can confirm whether or not that would be beneficial for you.

    13 iunie 2012 19:09
  • Trying to figure out how to check the Workflow history.
    13 iunie 2012 20:29
  • Hi Jerry,

    If you open the workflow in sharepoint designer, and view the workflow settings you can click the "open history list". view the associated history list.  Once the history list is open in designer, the view in a browser button will bring you to the list. 

    13 iunie 2012 20:44
  • Thanks t_zin.  I see "open history list" and I can get that far but I don't see an associated history list.

    In the "Views" box there is "All History" but it doesn't have current data and there appears to be no way to view other data.

    13 iunie 2012 21:02
  • Brandon,

    I put  "Trying to email [CurrentItem:CreatedBY]**"  and I get

    "Trying to email**"  So there is apparently nothing there.

    13 iunie 2012 21:15
  • Jerry,

    Is sounds like you opened the history list in designer.  Look in the ribbon above do you see "Preview in browser"?

    13 iunie 2012 21:18
  • That would lead me to believe there may be a problem involving User Profiles or AD.

    13 iunie 2012 21:33
  • Hi Jerrv444,

    In my opinion, the problem may be that:
    You returen the created by field as email address, but in your AD, the email address field may be blank and so when you imported it to Sharepoint, this field also be blank, so when you try to return the email address, you got nothing.

    Thanks,
    Simon


    Simon Huang

    TechNet Community Support

    14 iunie 2012 06:36
  • Jerry,

    Is sounds like you opened the history list in designer.  Look in the ribbon above do you see "Preview in browser"?

    Thanks!  that helps.   I'm getting this error:  "The email message cannot be sent.  Make sure the email has a valid recipient"

    I'm going to check AD to see what it has there.

    14 iunie 2012 13:53
  • In the Workflow history I see that for this error it is showing the user as "System Account".  When I click on "System Account" it shows a profile for it and it shows the work email as blank.  

    There is an "Edit" link but when I click on it it doesn't provide a way to edit the "work email" field.

    14 iunie 2012 15:36
  • It appears that the problem is that is showing me logged in under the system account and not my user account.
    14 iunie 2012 19:17
  • Hi guys, Did you get a solution for this??

    I am having the same issue. Emails were working fine for all workflows but now they are intermittantly (from my observation) not sending through. At certain times, i.e. night times the emails have worked fine but then i try during the day and i get "The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly." error message. If i use the direct email (user@domain.com) the emails work fine. I am thinking it might be an Active Directory thing because I have checked all of the emails associated with the AD accounts I am testing and they are all fine.

    18 iulie 2012 01:17
  • Hi Jerry,

      If the current item created by is system account you would not be able to send emails.Please create an item with a different user account,for which email has been configured.try sending the mail.

    18 iulie 2012 01:45