コード例 #1
0
        private static string GetLabel(bool fromUser, MessageRole messageSenderRole)
        {
            if (fromUser)
            {
                return(Resources.Global.Messages_FromYou);
            }

            return(MessageRoleTranslationHelper.From(messageSenderRole));
        }
コード例 #2
0
        public void SendNewMessageNotification(SantaUser recipient, MessageRole @from, string messageText)
        {
            var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);

            var subject = string.Format(Resources.Global.Email_NewMessage_Subject, MessageRoleTranslationHelper.From(from));
            var body    = string.Format(Resources.Global.Email_NewMessage_Body, recipient.DisplayName, MessageRoleTranslationHelper.From(from),
                                        messageText, urlHelper.Action("Index", "Messages", new { }, HttpContext.Current.Request.Url.Scheme));

            SendEmail(recipient.Email, subject, body);
        }