1

I have a Sharepoint 2010 installation and I have troubles getting this works: I have a list with some columns:

  • Place
  • Assigned to
  • Date and time
  • Comments

I want Sharepoint sends an email when a new list item is created. The email must be send to "Assigned to" person, who can be any on the Active Directory.

After that, I also want (if possible) that Sharepoint puts a new appoitment in the Exchange calendar of "Assigned to" person with the "Date and time"

Can someone help me?

Thanks

5 Answers 5

2

you have to create sharepoint workflow (using sharepoint designer) which starts when item is created in this list , this workflow will send an e-mail to the "Assigned to" user

check this link to find more info. about sending email in a workflow

http://office.microsoft.com/en-001/sharepoint-designer-help/send-e-mail-in-a-workflow-HA010239042.aspx

2
  • 1
    I always thought in a workflow like something which creates tasks, and I don't need any task for this. I'm reading the article. Thank you very much
    – Tomás Crespo García
    Commented May 22, 2013 at 10:55
  • @TomásCrespoGarcía you are welcome Commented May 22, 2013 at 11:16
1

Maybe I'm thinking too much like a dev and not enough like someone looking for the simplest solution available, but it seems to me that you want to create an event receiver that operates on the list when the ItemAdded trigger is pulled. Here is a guide on how to set up an event receiver for a specific list instance:

http://msdn.microsoft.com/en-us/library/ff398052.aspx

Once you've set up that event receiver, you can send the email within it or within a supporting class using the SPUtility.SendEmail method.

SPUtility.SendEmail(web, false, false, to, subject, htmlBody, false);

Where...

  • "web" is an SPWeb object.
  • "to" is the email address that you're sending the email to. You can call the email from the item using code similar to the following:

    SPUser user = (SPUser)item["AssignedTo"];
    string to = user.Email;
    
  • "subject" is the subject line.

  • "htmlBody" is the body.
0

Thanks JohnWCraven, that sound great!

I have followed your link, creating a breakpoint in the base.ItemAdding() line, and the breakpoint is hit when I add a new element to the list.

However when I add a few more lines of code, either above or below of base.ItemAdding(), no breakpoint hit, my code isn't executing, so I can't send an email.

I can't figure what's happening, Can you help me to continue?

0

Sharepoint designer workflow is simplest solution. It will not create any task. On creation of a list item, mail will be triggered to assigned to person and workflow ends. You have to use only "Send an Email" action for this. You can use event handler or receiver too for that , but it will be itemAdded() event. I will definitely suggest Workflow for your requirement, it will be simple and need no custom coding. thanks....

-2

Creating via workflow and event receiver are both the possible options .

Creating a workflow with Sharepoint Designer might be the quickest and easiest way as it can provide u with email UI template to fill in easily.

If u need a little more customization apart from just sending the mail then you can go for event reciever.

Thanks, Aravind

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.