/// <summary>
        /// Factory method for creating a new instance of SendGridIntegration.
        /// </summary>
        /// <param name="apiKey">API key of the SendGrid account.</param>
        /// <param name="sender">Email address of the message sender.</param>
        /// <param name="configurator">Lambda expression for configuring the SendGrid integration.</param>
        /// <returns>Instance of SendGridIntegration.</returns>
        public static SendGridIntegration Create(string apiKey, string sender,
                                                 Action <SendGridIntegrationConfiguration.Builder> configurator = null)
        {
            var config = new SendGridIntegrationConfiguration.Builder(apiKey, sender);

            configurator?.Invoke(config);

            return(Create(config.Build()));
        }
Example #2
0
        /// <summary>
        /// Factory method for creating a new instance of SendGridIntegration.
        /// </summary>
        /// <param name="username">Username of the SendGrid account.</param>
        /// <param name="password">Password of the SendGrid account.</param>
        /// <param name="sender">Email address of the message sender.</param>
        /// <param name="configurator">Lambda expression for configuring the SendGrid integration.</param>
        /// <returns>Instance of SendGridIntegration.</returns>
        public static SendGridIntegration Create(string username, string password, string sender,
                                                 Action <SendGridIntegrationConfiguration.Builder> configurator)
        {
            var config = new SendGridIntegrationConfiguration.Builder(username, password, sender);

            configurator?.Invoke(config);

            return(Create(config.Build()));
        }