コード例 #1
0
        /// <summary>
        /// Sends this welcome email to user who just installed the app.
        /// The content can be set in the database using the settings admin panel.
        /// </summary>
        /// <param name="sendTo">Users email address</param>
        /// <returns></returns>
        public async Task <bool> UserWelcomeEmailAsync(string sendTo)
        {
            try
            {
                _Emailer.AddTo(sendTo);
                var welcomeMsg = _Settings.GetValue(CORE_SYSTEM_SETTING_NAMES.WELCOME_EMAIL_TEMPLATE);
                _Emailer.SetFromAddress(_Settings.GetShopifyFromEmailAddress());
                _Emailer.SetMessage(welcomeMsg, true);
                _Emailer.SetSubject($"Welcome To {_Settings.GetAppName()}");
                var result = await _Emailer.Send(true);

                if (result)
                {
                    _Logger.LogInformation("Sending user welcome email was successful.");
                }
                else
                {
                    _Logger.LogInformation("Sending user welcome email was unsuccessful.");
                }
                return(result);
            }
            catch (Exception ex)
            {
                _Logger.LogError(ex, $"Error sending welcome email.{ex.Message}");
                return(false);
            }
        }
コード例 #2
0
 public static string GetAppSupportEmailAddress(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_SUPPORT_EMAIL_ADDRESS);
コード例 #3
0
 public static string GetShopifyFromEmailAddress(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_EMAILS_FROM_ADDRESS);
コード例 #4
0
 public static string GetShopifyApiKey(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.API_KEY);
コード例 #5
0
 public static string GetShopifySecretKey(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SECRET_KEY);
コード例 #6
0
 public static List <string> GetShopifyEmailSubscriberList(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_EVENT_EMAIL_SUBSCRIBERS)
 .Split(new string[] { ";", "," }, StringSplitOptions.RemoveEmptyEntries)
 .ToList();
コード例 #7
0
 public static string GetGetSendGridApiKey(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SEND_GRID_API_KEY);
コード例 #8
0
 public static string GetAppUninstallControllerName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.UNINSTALL_CONTROLLER);
コード例 #9
0
 public static string GetAppName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_NAME);
コード例 #10
0
 public static string GetAppBaseUrl(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_BASE_URL);
コード例 #11
0
 public static string GetPasswordSalt(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.PASSWORD_SALT);
コード例 #12
0
 public static List <string> GetAdminIps(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.PRIVILEGED_IPS)
 .Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries)
 .ToList();
コード例 #13
0
 public static string GetValue(this IDbSettingsReader reader, CORE_SYSTEM_SETTING_NAMES settingName) =>
 reader.GetValue(CORE_SETTINGS_GROUP_NAME.ToString(), settingName.ToString());
コード例 #14
0
 /// <summary>
 /// This indicates the framework version that initialized/created the database.
 /// This should not be set manually in the database. But only by the data seeder (<see cref="Extensions.AppBuilderExtensions.UseExicoShopifyFramework(Microsoft.AspNetCore.Builder.IApplicationBuilder)"/>) of the
 /// framework itself so that the framework <seealso cref="FRAMEWORK_VERSION"/> and this
 /// value are same.
 /// </summary>
 /// <param name="reader"></param>
 /// <returns></returns>
 public static string GetDataSeederFrameworkVersion(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SEEDER_FRAMEWORK_VERSION);
コード例 #15
0
        ///// <summary>
        ///// Returns the framework version.This is not same as the framework build number but it is same as the
        ///// value returned by <see cref="GetSeederFrameworkVersion()"/> method. Also nuget version wont match with this one.
        ///// And lastly this is set manually by the framework author.
        ///// </summary>
        ///// <returns>version number in major.minor.patch pattern.</returns>
        //public static string GerFrameWorkVersion(this IDbSettingsReader reader)
        //{
        //    return FRAMEWORK_VERSION;
        //}

        /// <summary>
        /// This is the version of the application that is built using this framework.
        /// This is set by the app developer not the framework.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static string GetAppVersion(this IDbSettingsReader reader) =>
        reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_VERSION);
コード例 #16
0
 public static string GetAppDashboardControllerName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.DASHBOARD_CONTOLLER);
コード例 #17
0
 public static string GetAppMyProfileControllerName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.MY_PROFILE_CONTOLLER);
コード例 #18
0
 public static string GetShopifyControllerName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_CONTROLLER);
コード例 #19
0
 public static string GetShopifyAppStoreUrl(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_APP_STOER_URL);
コード例 #20
0
 public static string GetAccountControllerName(this IDbSettingsReader reader) =>
 reader.GetValue(CORE_SYSTEM_SETTING_NAMES.ACCOUNT_CONTOLLER);