File: mailTemplate.py

package info (click to toggle)
mobyle 1.5.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,272 kB
  • ctags: 2,745
  • sloc: python: 22,649; sh: 57; makefile: 31; xml: 6; ansic: 5
file content (270 lines) | stat: -rw-r--r-- 9,583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#####################################################
# Here are the different email templates sent to the user
# Each template is structured as follows:
#
# From:         required
# Cc:           optional  
# Subject:      required
# Reply-To:     optional
#               an empty line
# the body of the email containing some keys to expand
#
###################################################



############################################################
#
# CONFIRM_SESSION email is sent to the user to confirm his 
# registration. 
# if config.AUTHENTICATED_SESSION = 'email'
# 
# the available keys are:
# SENDER      : the email address which sends the mail as defined in the configuration
# HELP        : the email of the Mobyle "hot line" as defined in the configuration
# SERVER_NAME : the url of the Mobyle portal
# CGI_URL     : the url of the portal cgi directory
# ACTIVATING_KEY : the key which allows the user to activate its session 
###########################################################

CONFIRM_SESSION = """
From: %(SENDER)s
Cc: 
Bcc: 
Subject: [ Mobyle server ( %(SERVER_NAME)s ) ] - new user confirmation" 
Reply-To: %(SENDER)s
Organization: Institut Pasteur, Paris.

You have requested an account on the %(SERVER_NAME)s Mobyle server.
Your login is: your email
Your activation key is: %(ACTIVATING_KEY)s 
To activate this account please click on the
following link (or paste its URL in your favourite browser):
%(CGI_URL)s/portal.py#user::activate
"""

####################################################################
#
# RESULTS_TOOBIG email is sent to the user when a job is finished 
# and the size of the results files is greater than Config.MAXMAILSIZE
# 
# the available keys are:
# SENDER      : the email address which sends the mail as defined in the configuration 
# HELP        : the email of the Mobyle "hot line" as defined in the configuration
# SERVER_NAME : the url of the Mobyle portal
# JOB_URL     : the url of the job
# JOB_NAME    : the name of the service ex blast2 , clustalw-multialign
# RESULTS_REMAIN : the number of days before the job is removed from the server, as defined in the configuration
#
####################################################################

RESULTS_TOOBIG = """
From: %(SENDER)s
Reply-To: %(SENDER)s
Subject: Your %(JOB_NAME)s job is finished. Access your results

Your results are too big to be sent by email.
They are accessible at the following address:
%(JOB_URL)s

Your results will be kept on our server for %(RESULTS_REMAIN)d days from now.
"""


####################################################################
#
# RESULTS_FILES email is sent to the user when a job is finished 
# Config.OPT_EMAIl = False
# 
# the available keys are:
# SENDER : the email address which sends the mail as defined in the configuration 
# HELP   : the email of the mobyle "hot line" as defined in the configuration
# SERVER_NAME : the url of the mobyle portal
# JOB_URL     : the url of the job
# JOB_NAME    : the name of the service ex blast2 , clustalw-multialign
# RESULTS_REMAIN : the number of days before the jobs will be erase as defined in the configuration
#
####################################################################

RESULTS_FILES = """
From: %(HELP)s
Reply-To: %(SENDER)s
Subject: Your %(JOB_NAME)s job is finished. Access your results

Your results are accessible at the following address:
%(JOB_URL)s

Your results will be kept on our server for %(RESULTS_REMAIN)d days from now.

An archive of your job is attached to this email. 
It includes the index.xml file which is a summary of your job submission 
(you can view it in your favorite web browser).
""" 

####################################################################
#
# RESULTS_NOTIFICATION email is sent to the user when a job is finished 
# but the results files zipping failed.
# 
# the available keys are:
# SENDER : the email address which sends the mail as defined in the configuration 
# HELP   : the email of the mobyle "hot line" as defined in the configuration
# SERVER_NAME : the url of the mobyle portal
# JOB_URL     : the url of the job
# JOB_NAME    : the name of the service ex blast2 , clustalw-multialign
# RESULTS_REMAIN : the number of days before the jobs will be erase as defined in the configuration
#
####################################################################

RESULTS_NOTIFICATION = """
From: %(HELP)s
Reply-To: %(SENDER)s
Subject: Your %(JOB_NAME)s job is finished. Access your results.

Your results are accessible at the following address:
%(JOB_URL)s

Your results will be kept on our server for %(RESULTS_REMAIN)d days from now.
"""

####################################################################
#
# LONG_JOB_NOTIFICATION email is sent to the user when a job is longer
# than Config.TIMEOUT
# 
# the available keys are:
# SENDER   : the email address which sends the mail as defined in the configuration 
# HELP     : the email of the mobyle "hot line" as defined in the configuration
# SERVER_NAME : the url of the mobyle portal
# JOB_URL  : the url of the job
# JOB_NAME : the name of the service ex blast2 , clustalw-multialign
# JOB_KEY  : the unique key wich permit to identify a job
# RESULTS_REMAIN : the number of days before the jobs will be erase as defined in the configuration
#
####################################################################

LONG_JOB_NOTIFICATION = """
From: %(HELP)s
Reply-To: %(SENDER)s
Subject: Your job %(JOB_NAME)s/%(JOB_KEY)s is running.

Your %(JOB_URL)s job is running on %(SERVER_NAME)s server.
You will receive the results by email.
You can access the results or check the job status at the following address:
%(JOB_URL)s
"""

####################################################################
#
#  email is send From the user to the mobyle help adress to request some help 
# 
# the available keys are:
# USER     : the user email address
# SENDER   : the email address which sends the mail as defined in the configuration 
# HELP     : the email of the mobyle "hot line" as defined in the configuration
# MSG      : the message written by the USER 
# SERVER_NAME   : the url of the mobyle portal
# SESSION_ID    : the session unique identifier
# SESSION_EMAIL : the user email store in the session
# SESSION_ACTIVATED : if the session is activated
# SESSION_AUTHENTICATED : if the session is authenticated
# JOB_URL         : the url of the job
# JOB_DATE        : the date at which this job was launch
# JOB_STATUS      : the mobyle job status ( finished, error ... )
# JOB_ERROR_PARAM : if there is an error, the parameter name that provoke the error
# JOB_ERROR_MSG   : the error message associated with the error
####################################################################

HELP_REQUEST = """
From: %(USER)s
Subject: [mobyle help request] help on job %(JOB_URL)s.

User Message:
%(MSG)s
    
from: %(USER)s

Session information:
- id: %(SESSION_ID)s
- email: %(SESSION_EMAIL)s
- activated?: %(SESSION_ACTIVATED)s
- authenticated?: %(SESSION_AUTHENTICATED)s

Job information:
- id: %(JOB_URL)s
- date: %(JOB_DATE)s
- status: %(JOB_STATUS)s
- user error in parameter: %(JOB_ERROR_PARAM)s
- user error message: %(JOB_ERROR_MSG)s
"""

####################################################################
#
#  email is sent to the user as a receipt of its help demand
# 
# the available keys are:
# USER     : the user email address
# SENDER   : the email address which sends the mail as defined in the configuration 
# HELP     : the email of the mobyle "hot line" as defined in the configuration
# MSG      : the message written by the USER 
# SERVER_NAME   : the url of the mobyle portal
# SESSION_ID    : the session unique identifier
# SESSION_EMAIL : the user email store in the session
# SESSION_ACTIVATED : if the session is activated
# SESSION_AUTHENTICATED : if the session is authenticated
# JOB_URL         : the url of the job
# JOB_DATE        : the date at which this job was launch
# JOB_STATUS      : the mobyle job status ( finished, error ... )
# JOB_ERROR_PARAM : if there is an error, the parameter name that provoke the error
# JOB_ERROR_MSG   : the error message associated with the error
#
####################################################################
HELP_REQUEST_RECEIPT = """
From: %(HELP)s
Reply-To: %(SENDER)s
Subject: [mobyle help request receipt] help on job %(JOB_URL)s.

We have received your help request (the message is included below). 
We will try to answer it as soon as possible.

User Message:
%(MSG)s
    
from: %(USER)s

Session information:
- id: %(SESSION_ID)s
- email: %(SESSION_EMAIL)s
- activated?: %(SESSION_ACTIVATED)s
- authenticated?: %(SESSION_AUTHENTICATED)s

Job information:
- id: %(JOB_URL)s
- date: %(JOB_DATE)s
- status: %(JOB_STATUS)s
- error parameter: %(JOB_ERROR_PARAM)s
- error message: %(JOB_ERROR_MSG)s
"""

######################################################################
#
# email is sent by mobpasswd ( if -m option ) to notify the user of a 
# password modification. 
#
# HELP          : the email of the mobyle "hot line" as defined in the configuration
# SENDER        : the email address which sends the mail as defined in the configuration 
# SERVER_NAME   : the url of the mobyle portal
# PASSWD        : the new password
#
######################################################################

NEW_PASSWD = """
From: %(HELP)s
Reply-To: %(SENDER)s
Subject: [ %(SERVER_NAME)s ] new password.

You have requested to change the password for your account on the
%(SERVER_NAME)s server.

Your new password is %(PASSWD)s
"""