Esempio n. 1
0
        /// <inheritdoc/>
        public IMailService InitMailService(string token, TimeZoneInfo timeZoneInfo, MailSource source)
        {
            switch (source)
            {
            case MailSource.Microsoft:
                var serviceClient = GraphClient.GetAuthenticatedClient(token, timeZoneInfo);
                return(new MSGraphMailAPI(serviceClient, timeZoneInfo));

            case MailSource.Google:
                var googleClient        = GoogleClient.GetGoogleClient(_skillConfig);
                var googleServiceClient = GMailService.GetServiceClient(googleClient, token);
                return(new GMailService(googleServiceClient));

            default:
                throw new Exception("Event Type not Defined");
            }
        }