Sending an email notification dynamically to the end user

In the previous recipe, we hardcoded most of the attributes related to sending an email to an administrator, as there was just one administrator. In this recipe, we will modify the previous recipe to send a Thank you for registration email to the users themselves.