// override Execute with your custom logic protected override ActivityExecutionStatus Execute(ActivityExecutionContext context) { // Create an instance of CustomActivityEventArgs CustomActivityEventArgs customActivityEventArgs = new CustomActivityEventArgs(this.Description); // raise the SendingEvent event and pass customActivityEventArgs this.RaiseGenericEvent<CustomActivityEventArgs>(SendingEvent, this, customActivityEventArgs); // This is where the logic of the e-mail should go Console.WriteLine("The Logic to send the e-mail goes here"); Console.WriteLine("The 'To' property is: " + this.To.ToString()); Console.WriteLine("The 'From' property is: " + this.From.ToString()); return ActivityExecutionStatus.Closed; }
// override Execute with your custom logic protected override ActivityExecutionStatus Execute(ActivityExecutionContext context) { // Create an instance of CustomActivityEventArgs CustomActivityEventArgs customActivityEventArgs = new CustomActivityEventArgs(this.Description); // raise the SendingEvent event and pass customActivityEventArgs this.RaiseGenericEvent <CustomActivityEventArgs>(SendingEvent, this, customActivityEventArgs); // This is where the logic of the e-mail should go Console.WriteLine("The Logic to send the e-mail goes here"); Console.WriteLine("The 'To' property is: " + this.To.ToString()); Console.WriteLine("The 'From' property is: " + this.From.ToString()); return(ActivityExecutionStatus.Closed); }
private void OnBeforeSend(object sender, CustomActivityEventArgs e) { Console.WriteLine(e.ActivityDescription + ": OnBeforeSend Event Handler - do any pre-processing logic here\n"); }