Created
September 7, 2011 14:32
-
-
Save mstarkman/1200724 to your computer and use it in GitHub Desktop.
Send method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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