Sender does not contain Id property...I can only find the following methods in sender as commented below
namespace AutoMoveCustomer { public class AutoMoveCustomerHandler : ApplicationBase { public AutoMoveCustomerHandler() { Document.AfterMove += new EventHandler<MoveEventArgs>(Document_AfterMove); }
Error 1 The type 'umbraco.interfaces.IApplication' is defined in an assembly that is not referenced. You must add a reference to assembly 'interfaces, Version=1.0.3931.19861, Culture=neutral, PublicKeyToken=null'. C:\Projects\AutoMoveCustomer\AutoMoveCustomer\AutoMoveCustomerHandler.cs 13 18 AutoMoveCustomer
event if document is moved
Hi,
I have the following structure
Customers
-Customer1
-Customer2 etc...
Unhandeled customers
-Customer1
-Customer2 etc...
When a customer fills in a form to become customer they are automatically placed under unhandeled customers node.
A business unit then fills in a few more properties on the customer before moving it to the Customer node.
I want to fire some kind of event when this happens and send a mail to the customer. How can it be achieved?
you just need to write a class for that:
public class DocumentEvent : ApplicationBase
add a handler to umbraco.cms.businesslogic.web.Document.AfterMove .
Check inside the handler if parent is Customers and then you can send mail.
Ok, that sounds really smooth and easy. Where do I write this class? Where do I place it so to speak?
Hi,
You'd be writing the class in Visual Studio...compile and copy the DLL to /bin/.
Here's some links to get started with sample code:
Wiki: Using ApplicationBase to register events
Richard Soeteman also had a good blog post about events
Hope this helps,
Tom
What eventhandler should I use for the AfterMove? PublishEventHandler, RollBackEventHandler..etc...
Never mind my last post :)
Heres a problem though :)
Sender does not contain Id property...I can only find the following methods in sender as commented below
try casting sender to Document or CMSNode, then id should be accessible.
Thanks guys!
New problems :)
Error 1 The type 'umbraco.interfaces.IApplication' is defined in an assembly that is not referenced. You must add a reference to assembly 'interfaces, Version=1.0.3931.19861, Culture=neutral, PublicKeyToken=null'. C:\Projects\AutoMoveCustomer\AutoMoveCustomer\AutoMoveCustomerHandler.cs 13 18 AutoMoveCustomer
get interfaces.dll out of the bin map of your site and add a reference to it in your project
is working on a reply...