Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. var note = new BookingConfirmNotification() { BookingId = 2 }
  2. SomeWayToQueue.Add(note)
  3.  
  4. var reminder = new ReminderNotification() { UserId = 3 }
  5. SomeWayToQueue.Add(reminder, TimeSpan.FromDays(1)
  6.  
  7. public void SendAccountVerificationEmail(
  8. [QueueTrigger(WebJobHelper.EmailProcessorQueueName)]
  9. AccountVerificationEmailTask task, TextWriter log)
  10. {
  11. log.WriteLine("START: SendAccountVerificationEmail: " + task.UserId);
  12.  
  13. const string template = "AccountVerification.cshtml";
  14. const string key = "account-verification";
  15.  
  16. PrepareAndSend(user.Email, "Account confirmation", template, key, task, typeof(AccountVerificationEmailTask));
  17.  
  18. log.WriteLine("END: SendAccountVerificationEmail: " + task.UserId);
  19. }
  20.  
  21. public void SendForgottonPasswordEmail(
  22. [QueueTrigger(WebJobHelper.EmailProcessorQueueName)]
  23. ForgottonPasswordEmailTask task, TextWriter log)
  24. {
  25. const string template = "ForgottonPassword.cshtml";
  26. const string key = "forgotton-password";
  27.  
  28. PrepareAndSend(user.Email, "Forgotton password", template, key, task, typeof(ForgottonPasswordEmailTask));
  29. }
  30.  
  31. _bus.Send(new BookingCreatedEvent{Ref="SomeRef", Customer="SomeCustomer"});
  32.  
  33. _bus.Send(new BookingCancelledEvent{Ref="SomeRef");
  34.  
  35. public static void SendBookingConfirmation([ServiceBusTrigger("BookingCreated","SendConfirmation")] BookingCreatedEvent bookingDetails)
  36. {
  37. // lookup customer details from booking details
  38. // send email to customer
  39. }
  40.  
  41. public static void UpdateBookingHistory([ServiceBusTrigger("BookingCreated","UpdateBookingHistory")] BookingCreatedEvent bookingDetails)
  42. {
  43. // save booking details to CRM
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement