def convert_reminder_string(reminder):
  """Convert reminder string to minutes integer.

  Keyword arguments:
    reminder: String representation of time,
              e.g. '10' for 10 minutes,
                   '1d' for one day,
                   '3h' for three hours, etc.
  Returns:
    Integer of reminder converted to minutes.

  Raises:
    ValueError if conversion failed.
  """
  if not reminder:
    return None
  unit = reminder.lower()[-1]
  value = reminder[:-1]
  if unit == 's':
    return int(value) / 60
  elif unit == 'm':
    return int(value)
  elif unit == 'h':
    return int(value) * 60
  elif unit == 'd':
    return int(value) * 60 * 24
  elif unit == 'w':
    return int(value) * 60 * 24 * 7
  else:
    return int(reminder)