Skip to content

Instantly share code, notes, and snippets.

@mstarkman
Created September 7, 2011 14:32
Show Gist options
  • Save mstarkman/1200724 to your computer and use it in GitHub Desktop.
Save mstarkman/1200724 to your computer and use it in GitHub Desktop.
Send method
#region Public Methods
public void Send(NotificationType type, NotificationTemplate template, ObjectId fromUserId, ObjectId toUserId)
{
if (type != NotificationType.Email)
return;
var fromUser = UserService.GetById(fromUserId);
var toUser = UserService.GetById(toUserId);
var toMailAddress = new MailAddress(toUser.EmailAddress, toUser.Name.FullName);
EmailRepository.Send(toMailAddress, TemplateProcessor.RenderTemplateForUser(type, template, fromUser, toUser));
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment