def build_and_send(self): addresses = self.get_addresses() subject = _(u"Invitation to join the HfPH relaunch") mail_tpl = self._build_mail() mail_plain = create_plaintext_message(mail_tpl) msg = prepare_email_message(mail_tpl, mail_plain) send_mail(msg, addresses, subject) return 'Done'
def _start_password_reset(self, userid): user = self.get_user(userid) subject = _(u"Invitation to join the HfPH portal") mail_tpl = self._compose_message(userid, message_type='invitation') mail_plain = create_plaintext_message(mail_tpl) msg = prepare_email_message(mail_tpl, mail_plain) recipients = list() recipients.append(user.getProperty('email')) send_mail(msg, recipients, subject) return userid
def reset_user(self, userid): user = self.get_user(userid) subject = _(u"Please change your account information for HfPH") mail_tpl = self._compose_message(userid, message_type='password') mail_plain = create_plaintext_message(mail_tpl) msg = prepare_email_message(mail_tpl, mail_plain) recipients = list() recipients.append(user.getProperty('email')) send_mail(msg, recipients, subject) return userid
def build_and_send(self, data): addresses = self.get_addresses(data) subject = _(u"Invitation to join the HfPH relaunch") mail_tpl = self._build_mail(data) mail_plain = create_plaintext_message(mail_tpl) msg = prepare_email_message(mail_tpl, mail_plain) send_mail(msg, addresses, subject) IStatusMessage(self.request).addStatusMessage( _(u"User invitation email has been sent successfully."), type='info') portal_url = api.portal.get().absolute_url() next_url = '{0}/ws/'.format(portal_url) return self.request.response.redirect(next_url)
def build_and_send(self): addresses = self.get_addresses() idx = 0 for addr in addresses: user = api.user.get(username=addr.getId()) confirmed = user.getProperty('confirmed', None) if confirmed is False: userid = user.getId() subject = _(u"Einladung zur neuen hfph.de Seite") mail_tpl = self._compose_invitation_message(userid) mail_plain = create_plaintext_message(mail_tpl) msg = prepare_email_message(mail_tpl, mail_plain) recipients = list() recipients.append(addr.getProperty('email')) send_mail(msg, recipients, subject) idx += 1 return idx