public SendAllMessagesAtOnce MapToSendAllAtOnce(CoordinatedSharedMessageModel model, CountryCodeReplacement countryCodeReplacement, List <string> excludedNumbers, string username) { return(new SendAllMessagesAtOnce { Messages = model .GetCleanInternationalisedNumbers(countryCodeReplacement) .Where(n => !excludedNumbers.Contains(n)) .Select(n => new SmsData(n, model.Message)) .ToList(), SendTimeUtc = DateTimeOlsenMapping.DateTimeWithOlsenZoneToUtc(model.StartTime, model.UserTimeZone), MetaData = new SmsMetaData { Tags = model.GetTagList(), Topic = model.Topic }, ConfirmationEmail = model.ConfirmationEmail, ConfirmationEmails = model.GetEmailList(), UserOlsenTimeZone = model.UserTimeZone, Username = username }); }
public TrickleSmsOverCalculatedIntervalsBetweenSetDates MapToTrickleOverPeriod(CoordinatedSharedMessageModel model, CountryCodeReplacement countryCodeReplacement, List <string> excludedNumbers, string username) { return(new TrickleSmsOverCalculatedIntervalsBetweenSetDates { Duration = model.SendAllBy.Value.Subtract(model.StartTime), Messages = model .GetCleanInternationalisedNumbers(countryCodeReplacement) .Where(n => !excludedNumbers.Contains(n)) .Select(n => new SmsData(n, model.Message)) .ToList(), StartTimeUtc = DateTimeOlsenMapping.DateTimeWithOlsenZoneToUtc(model.StartTime, model.UserTimeZone), // startTimeUtc,// model.StartTime.ToUniversalTime(), MetaData = new SmsMetaData { Tags = model.GetTagList(), Topic = model.Topic }, ConfirmationEmail = model.ConfirmationEmail, ConfirmationEmails = model.GetEmailList(), UserOlsenTimeZone = model.UserTimeZone, Username = username }); }