public RecipientData[] GetRecipients(EventType type, EventDataForEntity data)
        {
            var roles = _recipients.GetRecipientRoles(type);

            return(roles.Length == 0
                                ? null
                                : GetRecipients(roles, data).ToArray());
        }
Beispiel #2
0
        public RecipientData[] GetRecipients(EventType type, EventDataForEntity data)
        {
            var application = _applications.Get(data.EntityId);

            var roles = _recipients.GetRecipientRoles(type);

            return(roles.Length == 0
                                ? null
                                : GetRecipients(application, roles).ToArray());
        }
Beispiel #3
0
        private EventTemplateModel GetModel(EventType eventType, string language)
        {
            var commonData = _templates.GetByEventType(eventType);

            var localization = commonData != null?_templates.GetLocalization(commonData.EmailTemplateId, language) : null;

            var recipients = _recipients.GetRecipientRoles(eventType);

            return(new EventTemplateModel
            {
                Body = localization != null ? localization.Body : null,
                Subject = localization != null ? localization.Subject : null,
                EnableEmailSend = commonData != null && commonData.EnableEmailSend,
                Language = language,
                EventType = eventType,
                Settings = EmailTemplateSettingsModelHelper.GetModel(recipients)
            });
        }