Implement sending a welcome email to accepted students.
diff --git a/app/soc/modules/gsoc/tasks/accept_proposals.py b/app/soc/modules/gsoc/tasks/accept_proposals.py
index 3a1757d..66a0f99 100644
--- a/app/soc/modules/gsoc/tasks/accept_proposals.py
+++ b/app/soc/modules/gsoc/tasks/accept_proposals.py
@@ -229,6 +229,30 @@
         template_string, context, parent=proposal.parent(),
         transactional=transactional)
 
+  def getWelcomeMailTxn(self, proposal, transactional=True):
+    """Returns the function to sent an welcome email for an accepted proposal.
+    """
+    sender_name, sender = mail_dispatcher.getDefaultMailSender()
+
+    student_entity = proposal.parent()
+    program_entity = proposal.program
+
+    context = {
+      'to': student_entity.email,
+      'to_name': student_entity.given_name,
+      'sender': sender,
+      'sender_name': sender_name,
+      'program_name': program_entity.name,
+      'subject': 'Welcome to %s' % program_entity.name,
+      }
+
+    messages = program_entity.getProgramMessages()
+    template_string = messages.accepted_students_welcome_msg
+
+    return mail_dispatcher.getSendMailFromTemplateStringTxn(
+        template_string, context, parent=proposal.parent(),
+        transactional=transactional)
+
   def getRejectProposalMailTxn(self, proposal):
     """Returns the function to sent an rejectance mail for the specified
     proposal.
@@ -275,7 +299,9 @@
     project = GSoCProject(parent=student_profile, **fields)
     student_info_key = student_profile.student_info.key()
 
-    mail_txn = self.getAcceptProposalMailTxn(
+    accepted_mail_txn = self.getAcceptProposalMailTxn(
+        proposal, transactional=transactional)
+    welcome_mail_txn = self.getWelcomeMailTxn(
         proposal, transactional=transactional)
 
     proposal_key = proposal.key()
@@ -294,7 +320,7 @@
 
       # add a task that performs conversion status per
       # proposal
-      status_task.add(transactional=True)
+      status_task.add(transactional=transactional)
 
       proposal = db.get(proposal_key)
       proposal.status = 'accepted'
@@ -306,7 +332,8 @@
       db.put(project)
       db.put(proposal)
       db.put(student_info)
-      mail_txn()
+      accepted_mail_txn()
+      welcome_mail_txn()
 
     db.RunInTransaction(acceptProposalTxn)
 
diff --git a/tests/app/soc/modules/gsoc/tasks/test_accept_proposals.py b/tests/app/soc/modules/gsoc/tasks/test_accept_proposals.py
index 18cce46..95e414d 100644
--- a/tests/app/soc/modules/gsoc/tasks/test_accept_proposals.py
+++ b/tests/app/soc/modules/gsoc/tasks/test_accept_proposals.py
@@ -171,6 +171,8 @@
     self.assertEqual(response.status_code, httplib.OK)
     self.assertEmailSent(to=self.student1.profile.email,
                          subject='Congratulations!')
+    self.assertEmailSent(to=self.student1.profile.email,
+                         subject='Welcome to %s' % self.gsoc.name)
     self.assertEmailNotSent(to=self.student2.profile.email)
 
     #assert post status of proposal to be accepted