Ignore:
Timestamp:
14 Jul 2021, 11:39:09 (3 years ago)
Author:
Henrik Bettermann
Message:

Send email to student after single record creation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r16431 r16551  
    359359            subject, body, config)
    360360
     361    def informNewStudent(self, user, pw, login_url, rpw_url):
     362        """Inform student that a new student account has been created.
     363        """
     364        subject = 'Your new Kofa student account'
     365        text = _(u"""Dear ${a},
     366
     367Your student record of the Student Registration and Information Portal of
     368${b} has been created for you.
     369
     370Your user name: ${c}
     371Your password: ${d}
     372Login: ${e}
     373
     374Or request a new secure password here: ${f}
     375
     376Regards
     377""")
     378        config = grok.getSite()['configuration']
     379        from_name = config.name_admin
     380        from_addr = config.email_admin
     381        rcpt_name = user.title
     382        rcpt_addr = user.email
     383
     384        text = _(text, mapping={
     385            'a': rcpt_name,
     386            'b': config.name,
     387            'c': user.name,
     388            'd': pw,
     389            'e': login_url,
     390            'f': rpw_url
     391            })
     392        body = translate(text, 'waeup.kofa',
     393            target_language=self.PORTAL_LANGUAGE)
     394        return send_mail(
     395            from_name, from_addr, rcpt_name, rcpt_addr,
     396            subject, body, config)
     397
     398
    361399    def inviteReferee(self, referee, applicant, url_info=None):
    362400        """Send invitation email to referee.
Note: See TracChangeset for help on using the changeset viewer.