public void OnDailyMantraSchedule( string username) { ApplicationSettings.DataConfiguration data = _applicationSettings.Data .SingleOrDefault(d => d.Username == username); if (data == null) { return; } int mantraIndex = data.DailyMantra.Mantras .Select((m, idx) => idx) .OrderBy(idx => Guid.NewGuid()) .First(); var client = new TwilioRestClient( _applicationSettings.Twilio.AccountSID, _applicationSettings.Twilio.AuthToken); Twilio.Rest.Api.V2010.Account.CallResource.Create( to: new Twilio.Types.PhoneNumber(data.PhoneNumber), from: new Twilio.Types.PhoneNumber(_applicationSettings.Twilio.PhoneNumber), url: new Uri(_applicationSettings.Twilio.VoiceEndpoint.FormatWith(data.Username, mantraIndex)), client: client); }
public void OnDailyTipSchedule( string username) { ApplicationSettings.DataConfiguration data = _applicationSettings.Data .SingleOrDefault(d => d.Username == username); if (data == null) { return; } string tip = data.DailyQuotes.Quotes .OrderBy(t => Guid.NewGuid()) .First(); var client = new TwilioRestClient( _applicationSettings.Twilio.AccountSID, _applicationSettings.Twilio.AuthToken); Twilio.Rest.Api.V2010.Account.MessageResource.Create( to: new Twilio.Types.PhoneNumber(data.PhoneNumber), from: new Twilio.Types.PhoneNumber(_applicationSettings.Twilio.PhoneNumber), body: tip, client: client); }