Пример #1
0
        /// <summary>
        /// Returns a  <see cref="NotificationMessageDisplay"/> by method key
        ///
        /// GET /umbraco/Merchello/NotificationsApi/GetNotificationsByMethod/{key}
        /// </summary>
        /// <param name="id">
        /// Key of the notification method
        /// </param>
        /// <returns>
        /// The <see cref="NotificationMessageDisplay"/>.
        /// </returns>
        public NotificationMessageDisplay GetNotificationMessagesByKey(Guid id)
        {
            var message = _notificationMessageService.GetByKey(id);

            if (message == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(message.ToNotificationMessageDisplay());
        }
Пример #2
0
 /// <summary>
 /// Gets a <see cref="INotificationMethod"/> by it's unique key(Guid)
 /// </summary>
 /// <param name="notificationMessageKey">The unique key (Guid) of the <see cref="INotificationMessage"/></param>
 /// <returns>A <see cref="INotificationMessage"/></returns>
 public INotificationMessage GetNotificationMessageByKey(Guid notificationMessageKey)
 {
     return(_notificationMessageService.GetByKey(notificationMessageKey));
 }