We present a study of the star formation and central black hole accretion activity of the galaxies hosted in the two nearby (z$sim$0.2) rich galaxy clusters Abell 983 and 1731. Aims: We are able to quantify both the obscured and unobscured star formation rates, as well as the presence of active galactic nuclei (AGN) as a function of the environment in which the galaxy is located. Methods: We targeted the clusters with unprecedented deep infrared Spitzer observations (0.2 mJy @ 24 micron), near-IR Palomar imaging and optical WIYN spectroscopy. The extent of our observations ($sim$ 3 virial radii) covers the vast range of possible environments, from the very dense cluster centre to the very rarefied cluster outskirts and accretion regions. Results: The star forming members of the two clusters present star formation rates comparable with those measured in coeval field galaxies. The analysis of the spatial arrangement of the spectroscopically confirmed members reveals an elongated distribution for A1731 with respect to the more uniform distribution of A983. The emerging picture is compatible with A983 being a fully evolved cluster, in contrast with the still actively accreting A1731. Conclusions: The analysis of the specific star formation rate reveals evidence of on-going galaxy pre-processing along A1731s filament-like structure. Furthermore, the decrease in the number of star forming galaxies and AGN towards the cluster cores suggests that the cluster environment is accelerating the ageing process of galaxies and blocking further accretion of the cold gas that fuels both star formation and black hole accretion activity.