0

What are my options for attaching an SPEmailEventReceiver to a document library? Should the Elements file contain the specific library?

<Elements.xml

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <Receivers ListTemplateId="101">
  <Receiver>
    <Name>EventReceiver1EmailReceived</Name>
    <Type>EmailReceived</Type>
    <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
    <Class>EmailLogic.EventReceiver1.EventReceiver1</Class>
    <SequenceNumber>10000</SequenceNumber>
  </Receiver>

</Receivers>
</Elements>

What about manual, programatic or powershell to attach it?

Colbs
  • 587
  • 10
  • 25

1 Answers1

0

Using VS is very easy, just select the Library after select List Email Event (using new element select "Event Receiver"), then in codebehind, using List parameter you can check if the Library is the one that you need comparing: ID, name, url, etc.

rolivares
  • 137
  • 1
  • 3
  • 12