public void SendInvite(Invite invite, string senderName, string senderEmail) { if (invite == null) { return; } if (invite.Department == null) { invite.Department = _departmentsService.GetDepartmentById(invite.DepartmentId); } _emailProvider.SendInviteMail(invite.Code.ToString(), invite.Department.Name, invite.EmailAddress, senderName, senderEmail); }
public async Task <bool> SendInviteAsync(Invite invite, string senderName, string senderEmail) { if (invite == null) { return(false); } if (invite.Department == null) { invite.Department = await _departmentsService.GetDepartmentByIdAsync(invite.DepartmentId); } await _emailProvider.SendInviteMail(invite.Code.ToString(), invite.Department.Name, invite.EmailAddress, senderName, senderEmail); return(true); }