|
a/Allura/allura/model/notification.py |
|
b/Allura/allura/model/notification.py |
|
... |
|
... |
27 |
|
27 |
|
28 |
from ming import schema as S
|
28 |
from ming import schema as S
|
29 |
from ming.orm import MappedClass, FieldProperty, ForeignIdProperty, RelationProperty, session
|
29 |
from ming.orm import MappedClass, FieldProperty, ForeignIdProperty, RelationProperty, session
|
30 |
|
30 |
|
31 |
from allura.lib import helpers as h
|
31 |
from allura.lib import helpers as h
|
|
|
32 |
import allura.tasks.mail_tasks
|
32 |
|
33 |
|
33 |
from .session import main_orm_session, project_orm_session
|
34 |
from .session import main_orm_session, project_orm_session
|
34 |
from .auth import User
|
35 |
from .auth import User
|
35 |
|
36 |
|
36 |
|
37 |
|
|
... |
|
... |
182 |
|
183 |
|
183 |
To unsubscribe from further messages, please visit <%s/auth/prefs/>
|
184 |
To unsubscribe from further messages, please visit <%s/auth/prefs/>
|
184 |
''' % (prefix, self.link, prefix)
|
185 |
''' % (prefix, self.link, prefix)
|
185 |
|
186 |
|
186 |
def send_direct(self, user_id):
|
187 |
def send_direct(self, user_id):
|
187 |
allura.tasks.mail_task.sendmail.post(
|
188 |
allura.tasks.mail_tasks.sendmail.post(
|
188 |
destinations=[str(user_id)],
|
189 |
destinations=[str(user_id)],
|
189 |
fromaddr=self.address,
|
190 |
fromaddr=self.from_address,
|
190 |
reply_to=self.reply_to_address,
|
191 |
reply_to=self.reply_to_address,
|
191 |
subject=self.subject,
|
192 |
subject=self.subject,
|
192 |
message_id=self._id,
|
193 |
message_id=self._id,
|
193 |
in_reply_to=self.in_reply_to,
|
194 |
in_reply_to=self.in_reply_to,
|
194 |
text=(self.text or '') + self.footer())
|
195 |
text=(self.text or '') + self.footer())
|
|
... |
|
... |
206 |
text.append('Message-ID: %s' % n._id)
|
207 |
text.append('Message-ID: %s' % n._id)
|
207 |
text.append('')
|
208 |
text.append('')
|
208 |
text.append(n.text or '-no text-')
|
209 |
text.append(n.text or '-no text-')
|
209 |
text.append(n.footer())
|
210 |
text.append(n.footer())
|
210 |
text = '\n'.join(text)
|
211 |
text = '\n'.join(text)
|
211 |
allura.tasks.mail_task.sendmail.post(
|
212 |
allura.tasks.mail_tasks.sendmail.post(
|
212 |
destinations=[str(user_id)],
|
213 |
destinations=[str(user_id)],
|
213 |
fromaddr=from_address,
|
214 |
fromaddr=from_address,
|
214 |
reply_to=reply_to_address,
|
215 |
reply_to=reply_to_address,
|
215 |
subject=subject,
|
216 |
subject=subject,
|
216 |
message_id=h.gen_message_id(),
|
217 |
message_id=h.gen_message_id(),
|
|
... |
|
... |
226 |
text.append('Message-ID: %s' % n._id)
|
227 |
text.append('Message-ID: %s' % n._id)
|
227 |
text.append('')
|
228 |
text.append('')
|
228 |
text.append(h.text.truncate(n.text or '-no text-', 128))
|
229 |
text.append(h.text.truncate(n.text or '-no text-', 128))
|
229 |
text.append(n.footer())
|
230 |
text.append(n.footer())
|
230 |
text = '\n'.join(text)
|
231 |
text = '\n'.join(text)
|
231 |
allura.tasks.mail_task.sendmail.post(
|
232 |
allura.tasks.mail_tasks.sendmail.post(
|
232 |
destinations=[str(user_id)],
|
233 |
destinations=[str(user_id)],
|
233 |
fromaddr=from_address,
|
234 |
fromaddr=from_address,
|
234 |
reply_to=from_address,
|
235 |
reply_to=from_address,
|
235 |
subject=subject,
|
236 |
subject=subject,
|
236 |
message_id=h.gen_message_id(),
|
237 |
message_id=h.gen_message_id(),
|