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