示例#1
0
        private async Task AddEventLinkToDescriptionAsync(CalendarEvent calEvent, Guid eventId, int orgId)
        {
            var orgShortName = (await _organizationsDbSet.FindAsync(orgId))?.ShortName;
            var eventUrl     = _appSettings.EventUrl(orgShortName, eventId.ToString());

            calEvent.Description += $"\n\n{eventUrl}";
        }
        private async Task <string> GetPostLinkAsync(WallType wallType, int wallId, string orgName, int postId)
        {
            switch (wallType)
            {
            case WallType.Events:
                var eventId = await _eventsDbSet
                              .Where(x => x.WallId == wallId)
                              .Select(x => x.Id)
                              .FirstAsync();

                return(_appSettings.EventUrl(orgName, eventId.ToString()));

            case WallType.Project:
                var projectId = await _projectsDbSet
                                .Where(x => x.WallId == wallId)
                                .Select(x => x.Id)
                                .FirstAsync();

                return(_appSettings.ProjectUrl(orgName, projectId.ToString()));

            case WallType.Main:
            case WallType.UserCreated:
            default:
                return(_appSettings.WallPostUrl(orgName, postId));
            }
        }
示例#3
0
        public async Task NotifyRemovedEventParticipantsAsync(string eventName, Guid eventId, int orgId, IEnumerable <string> users)
        {
            var organization = await _organizationService.GetOrganizationByIdAsync(orgId);

            var emails = await _usersDbSet
                         .Where(u => users.Contains(u.Id))
                         .Select(u => u.Email)
                         .ToListAsync();

            var userNotificationSettingsUrl = _appSettings.UserNotificationSettingsUrl(organization.ShortName);
            var eventUrl = _appSettings.EventUrl(organization.ShortName, eventId.ToString());

            var emailTemplateViewModel = new EventParticipantExpelledEmailTemplateViewModel(userNotificationSettingsUrl, eventName, eventUrl);
            var emailBody = _mailTemplate.Generate(emailTemplateViewModel, EmailPremiumTemplateCacheKeys.EventParticipantExpelled);

            await _mailingService.SendEmailAsync(new EmailDto(emails, Resources.Models.Events.Events.ResetParticipantListEmailSubject, emailBody));
        }
示例#4
0
        private string GetPostLink(WallType wallType, int wallId, string orgName, int postId)
        {
            switch (wallType)
            {
            case WallType.Events:
                var eventId = _eventsDbSet
                              .Where(x => x.WallId == wallId)
                              .Select(x => x.Id)
                              .First();
                return(_appSettings.EventUrl(orgName, eventId.ToString()));

            case WallType.Project:
                var projectId = _projectsDbSet
                                .Where(x => x.WallId == wallId)
                                .Select(x => x.Id)
                                .First();
                return(_appSettings.ProjectUrl(orgName, projectId.ToString()));

            default:
                return(_appSettings.WallPostUrl(orgName, postId));
            }
        }
示例#5
0
        private string GetPostLink(EntityModels.Models.Multiwall.Wall wall, string orgName, Post post)
        {
            switch (wall.Type)
            {
            case WallType.Events:
                var eventId = _eventsDbSet
                              .Where(x => x.WallId == wall.Id)
                              .Select(x => x.Id)
                              .First();
                return(_appSettings.EventUrl(orgName, eventId.ToString()));

            case WallType.Project:
                var projectId = _projectsDbSet
                                .Where(x => x.WallId == wall.Id)
                                .Select(x => x.Id)
                                .First();
                return(_appSettings.ProjectUrl(orgName, projectId.ToString()));

            default:
                return(_appSettings.WallPostUrl(orgName, post.Id));
            }
        }