public SmtpNotificationGatewayMethod(IGatewayProviderService gatewayProviderService, INotificationMethod notificationMethod, ExtendedDataCollection extendedData)
            : base(gatewayProviderService, notificationMethod)
        {
            Mandate.ParameterNotNull(extendedData, "extendedData");

            _settings = extendedData.GetSmtpProviderSettings();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SmtpNotificationGatewayMethod"/> class.
        /// </summary>
        /// <param name="gatewayProviderService">
        /// The gateway provider service.
        /// </param>
        /// <param name="notificationMethod">
        /// The notification method.
        /// </param>
        /// <param name="extendedData">
        /// The extended data.
        /// </param>
        public SmtpNotificationGatewayMethod(IGatewayProviderService gatewayProviderService, INotificationMethod notificationMethod, ExtendedDataCollection extendedData)
            : base(gatewayProviderService, notificationMethod)
        {
            Mandate.ParameterNotNull(extendedData, "extendedData");

            _settings = extendedData.GetSmtpProviderSettings();
        }
        private void GatewayProviderServiceOnSaved(IGatewayProviderService sender, SaveEventArgs<IGatewayProviderSettings> args)
        {
            var key = new Guid("5F2E88D1-6D07-4809-B9AB-D4D6036473E9");
            var provider = args.SavedEntities.FirstOrDefault(x => key == x.Key && !x.HasIdentity);
            if (provider == null) return;

            var settings = new SmtpNotificationGatewayProviderSettings("smtp.gmail.com")
                               {
                                    Port = 587,
                                    EnableSsl = true,
                                    UserName = "******",
                                    Password = "******"
                               };

            provider.ExtendedData.SaveSmtpProviderSettings(settings);
        }
Esempio n. 4
0
        /// <summary>
        /// Saves <see cref="SmtpNotificationGatewayProviderSettings"/> to an ExtendedDataCollection
        /// </summary>
        /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
        /// <param name="settings">The <see cref="SmtpNotificationGatewayProviderSettings"/> to save</param>
        public static void SaveSmtpProviderSettings(this ExtendedDataCollection extendedData, SmtpNotificationGatewayProviderSettings settings)
        {
            var settingsJson = JsonConvert.SerializeObject(settings);

            extendedData.SetValue(Constants.ExtendedDataKeys.SmtpProviderSettings, settingsJson);
        }
        /// <summary>
        /// Saves <see cref="SmtpNotificationGatewayProviderSettings"/> to an ExtendedDataCollection
        /// </summary>
        /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
        /// <param name="settings">The <see cref="SmtpNotificationGatewayProviderSettings"/> to save</param>
        public static void SaveSmtpProviderSettings(this ExtendedDataCollection extendedData, SmtpNotificationGatewayProviderSettings settings)
        {
            var settingsJson = JsonConvert.SerializeObject(settings);

            extendedData.SetValue(Constants.ExtendedDataKeys.SmtpProviderSettings, settingsJson);
        }