public async Task <IActionResult> SendProjectNotificationAsync(int templateId, string to, string cc, string bcc, int projectId) { var project = _pimsService.Project.Get(projectId); var env = new Entity.Models.EnvironmentModel(_options.Environment.Uri, _options.Environment.Name, _options.Environment.Title); var model = new Entity.Models.ProjectNotificationModel(Guid.NewGuid(), env, project, project.Agency); var notification = await _pimsService.NotificationTemplate.SendNotificationAsync(templateId, to, cc, bcc, model); return(CreatedAtAction(nameof(QueueController.GetNotificationQueue), new { controller = "queue", id = notification.Id }, _mapper.Map <Models.Queue.NotificationQueueModel>(notification))); }
/// <summary> /// Creates a new instance of an AccessRequestNotificationModel, initializes it with specified arguments. /// </summary> /// <param name="accessRequest"></param> /// <param name="options"></param> public AccessRequestNotificationModel(Entity.AccessRequest accessRequest, PimsOptions options) { this.AccessRequest = accessRequest; this.Environment = new Entity.Models.EnvironmentModel(options.Environment.Uri, options.Environment.Name, options.Environment.Title); }
/// <summary> /// Creates a new instance of an AccessRequestNotificationModel, initializes it with specified arguments. /// </summary> /// <param name="accessRequest"></param> /// <param name="env"></param> public AccessRequestNotificationModel(Entity.AccessRequest accessRequest, Entity.Models.EnvironmentModel env) { this.AccessRequest = accessRequest; this.Environment = env; }