The Divine Mercy Sunday indulgence is a special type of plenary indulgence by which all sins are forgiven and all punishment due for those sins is remitted (wiped away). To obtain the indulgence:
1. Go to Confession within about 20 days before or after Divine Mercy Sunday (the Sunday AFTER Easter Sunday)
2. Receive Communion (preferably at Mass) on Divine Mercy Sunday (or the Saturday vigil Mass)
3. Say a prayer for the intentions of Pope Francis (any devout prayer is fine, but one Our Father and one Hail Mary is suggested)
In my opinion, detachment from even venial sin (a usual requirement for a plenary indulgence) is not required for the Divine Mercy indulgence. It is a special type of indulgence, whereby that requirement is dispensed.
I think that the person performing the works above (#1-3) must have the intention to obtain the indulgence, but I cannot be certain if that is required.
— Ronald L. Conte Jr.