/// <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); } }
public static string GetAppSupportEmailAddress(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_SUPPORT_EMAIL_ADDRESS);
public static string GetShopifyFromEmailAddress(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_EMAILS_FROM_ADDRESS);
public static string GetShopifyApiKey(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.API_KEY);
public static string GetShopifySecretKey(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SECRET_KEY);
public static List <string> GetShopifyEmailSubscriberList(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_EVENT_EMAIL_SUBSCRIBERS) .Split(new string[] { ";", "," }, StringSplitOptions.RemoveEmptyEntries) .ToList();
public static string GetGetSendGridApiKey(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SEND_GRID_API_KEY);
public static string GetAppUninstallControllerName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.UNINSTALL_CONTROLLER);
public static string GetAppName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_NAME);
public static string GetAppBaseUrl(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.APP_BASE_URL);
public static string GetPasswordSalt(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.PASSWORD_SALT);
public static List <string> GetAdminIps(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.PRIVILEGED_IPS) .Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries) .ToList();
public static string GetValue(this IDbSettingsReader reader, CORE_SYSTEM_SETTING_NAMES settingName) => reader.GetValue(CORE_SETTINGS_GROUP_NAME.ToString(), settingName.ToString());
/// <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);
///// <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);
public static string GetAppDashboardControllerName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.DASHBOARD_CONTOLLER);
public static string GetAppMyProfileControllerName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.MY_PROFILE_CONTOLLER);
public static string GetShopifyControllerName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_CONTROLLER);
public static string GetShopifyAppStoreUrl(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.SHOPIFY_APP_STOER_URL);
public static string GetAccountControllerName(this IDbSettingsReader reader) => reader.GetValue(CORE_SYSTEM_SETTING_NAMES.ACCOUNT_CONTOLLER);