Envoyer par SMS: The environment and redshift dependence of accretion on to dark matter haloes and subhaloes