116
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCWriteOnlyRepository subclass:#MCSmtpRepository
|
|
4 |
instanceVariableNames:'email'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
680
|
7 |
category:'SCM-Monticello-Repositories'
|
116
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCSmtpRepository class methodsFor:'as yet unclassified'!
|
|
12 |
|
|
13 |
morphicConfigure
|
|
14 |
| address |
|
220
|
15 |
address := UIManager default request: 'Email address:' translated.
|
116
|
16 |
^ address isEmpty ifFalse: [self new emailAddress: address]
|
|
17 |
! !
|
|
18 |
|
900
|
19 |
!MCSmtpRepository class methodsFor:'queries'!
|
|
20 |
|
|
21 |
description
|
|
22 |
^ 'SMTP'
|
|
23 |
! !
|
116
|
24 |
|
900
|
25 |
!MCSmtpRepository methodsFor:'accessing'!
|
|
26 |
|
|
27 |
description
|
|
28 |
^ 'mailto://', email
|
|
29 |
! !
|
|
30 |
|
|
31 |
!MCSmtpRepository methodsFor:'as yet unclassified'!
|
116
|
32 |
|
|
33 |
bodyForVersion: aVersion
|
|
34 |
^ String streamContents:
|
|
35 |
[ :s |
|
|
36 |
s nextPutAll: 'from version info:'; cr; cr.
|
|
37 |
s nextPutAll: aVersion info summary]
|
|
38 |
!
|
|
39 |
|
|
40 |
emailAddress: aString
|
220
|
41 |
email := aString
|
116
|
42 |
!
|
|
43 |
|
|
44 |
messageForVersion: aVersion
|
|
45 |
| message data |
|
|
46 |
message := MailMessage empty.
|
|
47 |
message setField: 'from' toString: MailSender userName.
|
|
48 |
message setField: 'to' toString: email.
|
|
49 |
message setField: 'subject' toString: (self subjectForVersion: aVersion).
|
|
50 |
|
|
51 |
message body:
|
|
52 |
(MIMEDocument
|
|
53 |
contentType: 'text/plain'
|
|
54 |
content: (self bodyForVersion: aVersion)).
|
|
55 |
|
|
56 |
"Prepare the gzipped data"
|
220
|
57 |
data := RWBinaryOrTextStream on: String new.
|
116
|
58 |
aVersion fileOutOn: data.
|
|
59 |
message addAttachmentFrom: data reset withName: aVersion fileName.
|
|
60 |
^ message
|
900
|
61 |
! !
|
|
62 |
|
|
63 |
!MCSmtpRepository methodsFor:'printing & storing'!
|
|
64 |
|
|
65 |
basicStoreVersion: aVersion
|
|
66 |
MailSender sendMessage: (self messageForVersion: aVersion)
|
|
67 |
! !
|
|
68 |
|
|
69 |
!MCSmtpRepository methodsFor:'queries'!
|
116
|
70 |
|
|
71 |
subjectForVersion: aVersion
|
|
72 |
^ '[Package] ', aVersion info name
|
|
73 |
! !
|
|
74 |
|
|
75 |
!MCSmtpRepository class methodsFor:'documentation'!
|
|
76 |
|
|
77 |
version
|
900
|
78 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSmtpRepository.st,v 1.5 2014-02-12 14:53:31 cg Exp $'
|
220
|
79 |
!
|
|
80 |
|
|
81 |
version_CVS
|
900
|
82 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSmtpRepository.st,v 1.5 2014-02-12 14:53:31 cg Exp $'
|
220
|
83 |
!
|
|
84 |
|
|
85 |
version_SVN
|
900
|
86 |
^ '$Id: MCSmtpRepository.st,v 1.5 2014-02-12 14:53:31 cg Exp $'
|
116
|
87 |
! !
|
900
|
88 |
|