User contribution is critical to online communities but also difficult to sustain given its public goods nature. This paper studies the design of IT artifacts to motivate voluntary contributions in online communities. We propose a dynamic approach, which allows the effect of motivating mechanisms to change across users over time. We characterize the dynamics of user contributions using a hidden Markov model (HMM) with latent motivation states under the public goods framework. We focus on three motivating mechanisms on transitioning users between the latent states: reciprocity, peer recognition, and self-image. Based on Bayesian estimation of the model with user-level panel data, we identify three motivation states (low, medium, and high), and show that the motivating mechanisms, implemented through various IT artifacts, could work differently across states. Specifically, reciprocity is only effective to transition users from low to medium motivation state, whereas peer recognition can boost all users to higher states. And self-image shows no effect when a user is already in high motivation state, although it helps users in low and medium states move to the high state. Design simulations on our structural model provide additional insights into the consequences of changing specific IT artifacts. These findings offer implications for platform designers on how to motivate user contributions and build sustainable online communities.