Mercurial > kallithea
comparison rhodecode/model/notification.py @ 1818:cf51bbfb120e beta
auto white-space removal
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 29 Dec 2011 07:35:51 +0200 |
parents | 6c86c987cf93 |
children | 89efedac4e6c |
comparison
equal
deleted
inserted
replaced
1817:523b1011a625 | 1818:cf51bbfb120e |
---|---|
66 | 66 |
67 :param created_by: int, str or User instance. User who created this | 67 :param created_by: int, str or User instance. User who created this |
68 notification | 68 notification |
69 :param subject: | 69 :param subject: |
70 :param body: | 70 :param body: |
71 :param recipients: list of int, str or User objects, when None | 71 :param recipients: list of int, str or User objects, when None |
72 is given send to all admins | 72 is given send to all admins |
73 :param type_: type of notification | 73 :param type_: type of notification |
74 :param with_email: send email with this notification | 74 :param with_email: send email with this notification |
75 :param email_kwargs: additional dict to pass as args to email template | 75 :param email_kwargs: additional dict to pass as args to email template |
76 """ | 76 """ |
204 } | 204 } |
205 | 205 |
206 def get_email_tmpl(self, type_, **kwargs): | 206 def get_email_tmpl(self, type_, **kwargs): |
207 """ | 207 """ |
208 return generated template for email based on given type | 208 return generated template for email based on given type |
209 | 209 |
210 :param type_: | 210 :param type_: |
211 """ | 211 """ |
212 | 212 |
213 base = self.email_types.get(type_, self.email_types[self.TYPE_DEFAULT]) | 213 base = self.email_types.get(type_, self.email_types[self.TYPE_DEFAULT]) |
214 email_template = self._tmpl_lookup.get_template(base) | 214 email_template = self._tmpl_lookup.get_template(base) |
215 # translator inject | 215 # translator inject |
216 _kwargs = {'_':_} | 216 _kwargs = {'_':_} |
217 _kwargs.update(kwargs) | 217 _kwargs.update(kwargs) |
218 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) | 218 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) |
219 return email_template.render(**_kwargs) | 219 return email_template.render(**_kwargs) |
220 | |
221 |