Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.48 KB | None | 0 0
  1.     if (user.Role.Code == "user") {
  2.                         registrationNotificationModel = new RegistrationNotificationEmailModel();
  3.  
  4.                         var newCustomerBase = user.Map<NewCustomerAddedBase>(Mapper);
  5.                             newCustomerBase.EmailTo = Settings.Default.AdminEmail; ;
  6.                             newCustomerBase.Affiliate.Company = affiliate.Map<CompanyEmailModel>(Mapper);
  7.                             newCustomerBase.Domain = gluedDomain;
  8.  
  9.                         var newCustomerAddedNotificationModel = new NewCustomerAddedNotificationEmailModel {
  10.                             NewCustomer = newCustomerBase,
  11.                             IsUserAdded = false
  12.                         };
  13.  
  14.                         BackgroundJob.Enqueue<IEmailService>(es => es.Send(newCustomerAddedNotificationModel));
  15.                     }
  16.                     else {
  17.                         registrationNotificationModel = new AffiliatesSignUpNotificationEmailModel {
  18.                             Company = company.Map<CompanyEmailModel>(Mapper)
  19.                         };
  20.  
  21.                         var newAffiliateAddedNotify = user.Map<NewAffiliateAddedNotificationEmailModel>(Mapper);
  22.                         newAffiliateAddedNotify.EmailTo = "partners@xoutplus.com, sean@xoutplus.com, anthony@xoutplus.com, pavel@xoutplus.com";
  23.                         newAffiliateAddedNotify.Domain = gluedDomain;
  24.                         BackgroundJob.Enqueue<IEmailService>(es => es.Send(newAffiliateAddedNotify));
  25.                     }
  26.                     registrationNotificationModel.Password = data.Password;
  27.                     registrationNotificationModel.User = Mapper.Map<RegistrationNotificationUserEmailModel>(user);
  28.                     registrationNotificationModel.Domain = gluedDomain;
  29.  
  30.                     BackgroundJob.Enqueue<IEmailService>(es => es.Send(registrationNotificationModel));
  31.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement