Version 1.27 by SuperUwe Trueggelmann on 2022-10-13

Show last authors
1 {{groovy}}
2
3 import groovy.sql.Sql
4
5 String strDBTable = "\"regUser\".\"newUser\""
6 def sqlConnection = new Sql(services.cmpConnectRegDB.connectRegDB())
7
8 String strCurRecCol = "firstname"
9 int intRecCount=0
10
11 String strContactID = ""
12 String strCompanyName = ""
13 String strTitle = ""
14 String strFirstname = ""
15 String strLastname = ""
16 String strPrefname = ""
17 String strRole = ""
18 String strLphone = ""
19 String strMphone = ""
20 String strEmail = ""
21 String strEmail2 = ""
22 String strCreateTime = java.time.ZonedDateTime.now()
23 String strCreateIP = request.remoteAddr
24 String strConfCode = ""
25 String strEmailBody = ""
26
27 String strFormStatus = "DataEntry"
28
29 String strEditCommand = request.get("butAction")
30 if (strEditCommand == null){
31 strEditCommand = "none"
32 xcontext.put("strEditCommand", strEditCommand)
33 }
34 // println "strEditCommand:" + strEditCommand
35
36 //Process Commands
37
38 if ((strEditCommand == "Correct") || (strEditCommand == "Register") || (strEditCommand == "Proceed")){
39
40 strCompanyName = services.cleanStr.alphanum(request.companyname)
41 strCompanyAddress = services.cleanStr.alphanum(request.companyaddress)
42 strCompanyCity = services.cleanStr.alphanum(request.companycity)
43 strCompanyPostcode = services.cleanStr.alphanum(request.companypostcode)
44 strCompanyProvince = services.cleanStr.alphanum(request.companyprovince)
45 strCompanyCountry = services.cleanStr.alphanum(request.companycountry)
46 strTitle = services.cleanStr.alphanum(request.title)
47 strFirstname = services.cleanStr.alphanum(request.firstname)
48 strLastname = services.cleanStr.alphanum(request.lastname)
49 strPrefname = services.cleanStr.alphanum(request.prefname)
50 strRole = services.cleanStr.alphanum(request.role)
51 strLphone = services.cleanStr.numphone(request.lphone)
52 strMphone = services.cleanStr.numphone(request.mphone)
53 strEmail = services.cleanStr.alphanum(request.email)
54 strEmail2 = services.cleanStr.alphanum(request.email2)
55 strCreateTime = java.time.ZonedDateTime.now()
56 strCreateIP = request.remoteAddr
57 strConfCode = services.genRandom.randStr(16)
58 if (strEditCommand == "Register"){
59 String sqlHowManyRecords = "SELECT count(createtime) as reccount FROM " + strDBTable + " where email='" + strEmail + "'"
60 intRecCount = sqlConnection.rows(sqlHowManyRecords).reccount[0] ?:0
61 if (intRecCount == 0){ //insert a new record
62 sqlQueryInsertRec = "INSERT INTO " + strDBTable +
63 """(
64 companyname,
65 companyaddress,
66 companycity,
67 companypostcode,
68 companyprovince,
69 companycountry,
70 title,
71 firstname,
72 lastname,
73 prefname,
74 role,
75 lphone,
76 mphone,
77 email,
78 email2,
79 createtime,
80 createip,
81 confemailsenttime,
82 confemailsentcode)
83 VALUES(
84 '$strCompanyName',
85 '$strCompanyAddress',
86 '$strCompanyCity',
87 '$strCompanyPostcode',
88 '$strCompanyProvince',
89 '$strCompanyCountry',
90 '$strTitle',
91 '$strFirstname',
92 '$strLastname',
93 '$strPrefname',
94 '$strRole',
95 '$strLphone',
96 '$strMphone',
97 '$strEmail',
98 '$strEmail2',
99 now(),
100 '$strCreateIP',
101 now(),
102 '$strConfCode')
103 ;"""
104 sqlConnection.execute(sqlQueryInsertRec)
105 }
106 else{ // update the existing record
107 sqlQueryInsertRec = "UPDATE " + strDBTable +
108 """
109 SET
110 companyname = '$strCompanyName',
111 companyaddress = '$strCompanyAddress',
112 companycity = '$strCompanyCity',
113 companypostcode = '$strCompanyPostcode',
114 companyprovince = '$strCompanyProvince',
115 companycountry = '$strCompanyCountry',
116 title = '$strTitle',
117 firstname = '$strFirstname',
118 lastname = '$strLastname',
119 prefname = '$strPrefname',
120 role = '$strRole',
121 lphone = '$strLphone',
122 mphone = '$strMphone',
123 email = '$strEmail',
124 email2 = '$strEmail2',
125 createtime = now(),
126 createip = '$strCreateIP',
127 confemailsenttime = now(),
128 confemailsentcode = '$strConfCode',
129 confreceivetime = null,
130 confreceivecode = '',
131 status = 'new'
132 WHERE email = '$strEmail';"""
133 sqlConnection.execute(sqlQueryInsertRec)
134 }
135 strEmailBody = "Dear " + strPrefname + ","
136 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "A request was made to register you to the CEC website (https://cecocert.com) with the following information:" + "\r\n" + "\r\n"
137 strEmailBody = strEmailBody + "Name: " + strTitle + " " + strFirstname + " " + strLastname + "\r\n"
138 strEmailBody = strEmailBody + "Registered Business Name: " + strCompanyName + "\r\n"
139 strEmailBody = strEmailBody + "Registered Business Address: " + strCompanyAddress + "\r\n"
140 strEmailBody = strEmailBody + "Registered Business City: " + strCompanyAddress + "\r\n"
141 strEmailBody = strEmailBody + "Registered Business Postal Code: " + strCompanyAddress + "\r\n"
142 strEmailBody = strEmailBody + "Registered Business Province/State: " + strCompanyAddress + "\r\n"
143 strEmailBody = strEmailBody + "Registered Business Country: " + strCompanyAddress + "\r\n"
144 strEmailBody = strEmailBody + "Role: " + strRole + "\r\n"
145 strEmailBody = strEmailBody + "Landline phone: " + strLphone + "\r\n"
146 strEmailBody = strEmailBody + "Mobile phone:" + strMphone + "\r\n" + "\r\n"
147 strEmailBody = strEmailBody + "The request was made from IP address: " + strCreateIP
148 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "Please click the below link to confirm your e-mail address:" + "\r\n"
149 strEmailBody = strEmailBody + "https://cecocert.com/bin/view/StartPage/X1100%20-%20Process%20e-mail%20confirmation/WebHome"
150 strEmailBody = strEmailBody + "?em=" + strEmail + "&cc=" + strConfCode
151 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "If you do not confirm your e-mail address within 24 hours, the information you entered will be deleted!"
152
153 // println strEmailBody
154 xcontext.put("strEmailBody",strEmailBody)
155 // services.writeLog.writeLogEntry(xcontext.getUser(), request.remoteAddr, doc.space, "INSERT AS NEW", intCurUID)
156 xcontext.put("strCompanyName",strCompanyName)
157 xcontext.put("strCompanyName",strCompanyAddress)
158 xcontext.put("strCompanyName",strCompanyCity)
159 xcontext.put("strCompanyName",strCompanyPostcode)
160 xcontext.put("strCompanyName",strCompanyProvince)
161 xcontext.put("strCompanyName",strCompanyCountry)
162 xcontext.put("strTitle",strTitle)
163 xcontext.put("strFirstname",strFirstname)
164 xcontext.put("strLastname",strLastname)
165 xcontext.put("strPrefname",strPrefname)
166 xcontext.put("strRole",strRole)
167 xcontext.put("strLphone",strLphone)
168 xcontext.put("strMphone",strMphone)
169 xcontext.put("strEmail",strEmail)
170 xcontext.put("strEmail2",strEmail2)
171 xcontext.put("strCreateIP",strCreateIP)
172 strFormStatus = "SendEmail"
173 }
174 if (strEditCommand == "Proceed"){
175 xcontext.put("strCompanyName",strCompanyName)
176 xcontext.put("strCompanyName",strCompanyAddress)
177 xcontext.put("strCompanyName",strCompanyCity)
178 xcontext.put("strCompanyName",strCompanyPostcode)
179 xcontext.put("strCompanyName",strCompanyProvince)
180 xcontext.put("strCompanyName",strCompanyCountry)
181 xcontext.put("strTitle",strTitle)
182 xcontext.put("strFirstname",strFirstname)
183 xcontext.put("strLastname",strLastname)
184 xcontext.put("strPrefname",strPrefname)
185 xcontext.put("strRole",strRole)
186 xcontext.put("strLphone",strLphone)
187 xcontext.put("strMphone",strMphone)
188 xcontext.put("strEmail",strEmail)
189 xcontext.put("strEmail2",strEmail2)
190 xcontext.put("strCreateIP",strCreateIP)
191 strFormStatus = "DataVerify"
192 }
193 if (strEditCommand == "Correct"){
194 xcontext.put("strCompanyName",strCompanyName)
195 xcontext.put("strCompanyName",strCompanyAddress)
196 xcontext.put("strCompanyName",strCompanyCity)
197 xcontext.put("strCompanyName",strCompanyPostcode)
198 xcontext.put("strCompanyName",strCompanyProvince)
199 xcontext.put("strCompanyName",strCompanyCountry)
200 xcontext.put("strTitle",strTitle)
201 xcontext.put("strFirstname",strFirstname)
202 xcontext.put("strLastname",strLastname)
203 xcontext.put("strPrefname",strPrefname)
204 xcontext.put("strRole",strRole)
205 xcontext.put("strLphone",strLphone)
206 xcontext.put("strMphone",strMphone)
207 xcontext.put("strEmail",strEmail)
208 xcontext.put("strEmail2",strEmail2)
209 xcontext.put("strCreateIP",strCreateIP)
210 strFormStatus = "DataCorrection"
211 }
212 }
213 sqlConnection.close()
214 xcontext.put("strFormStatus", strFormStatus)
215
216 {{/groovy}}
217
218 {{velocity}}
219 ##$xcontext.strFormStatus
220 #if( $xcontext.strFormStatus == "DataEntry" )
221 {{html wiki=false clean=false}}
222 <head>
223 <style>
224 #cecTable {
225 font-family: Arial, Helvetica, sans-serif;
226 border-collapse: collapse;
227 border-color: #007d84
228 width: 100%;
229 }
230
231 #cecTable td, #cecTable th {
232 border: 1px solid #007d84;
233 padding: 8px;
234 }
235
236 #cecTable tr:nth-child(even){background-color: #d0d3d4;}
237
238 #cecTable tr:hover {background-color: #ddd;}
239
240 #cecTable th {
241 padding-top: 12px;
242 padding-bottom: 12px;
243 text-align: left;
244 background-color: #007d84;
245 color: white;
246 }
247 </style>
248 </head>
249 <form action="" class="xformInline" method="post" name="Contact Edit Form">
250 <table id="cecTable"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
251 <col style="width:30%">
252 <col style="width:70%">
253 <th colspan = "2">
254 <b>Company Information</b>
255 </th>
256 <tr>
257 <td align="left" class="style1">Company name:</td>
258 <td class="style1">
259 <input type="text" id="companyname" name="companyname" placeholder="Enter the legal name of your company" size="50">
260 </select>
261 </td>
262 </tr>
263 <tr>
264 <td align="left" class="style1">Registered Business Address - House Number, Street:</td>
265 <td class="style1">
266 <input type="text" id="companyaddress" name="companyaddress" placeholder="Enter the House Number, Street, Floor, etc part of your company's registered business address" size="100">
267 </select>
268 </td>
269 </tr>
270 <tr>
271 <td align="left" class="style1">Registered Business Address - City:</td>
272 <td class="style1">
273 <input type="text" id="companycity" name="companycity" placeholder="Enter the City part of your company's registered business address" size="100">
274 </select>
275 </td>
276 </tr>
277 <tr>
278 <td align="left" class="style1">Registered Business Address - Postal Code:</td>
279 <td class="style1">
280 <input type="text" id="companypostcode" name="companypostcode" placeholder="Enter the Postal Code part of your company's registered business address" size="100">
281 </select>
282 </td>
283 </tr>
284 <tr>
285 <td align="left" class="style1">Registered Business Address - Province or State:</td>
286 <td class="style1">
287 <input type="text" id="companyprovince" name="companyprovince" placeholder="Enter the Province or State part of your company's registered business address, leave empty if n/a" size="100">
288 </select>
289 </td>
290 </tr>
291 <tr>
292 <td align="left" class="style1">Registered Business Address - Country:</td>
293 <td class="style1">
294 <input type="text" id="companycountry" name="companycountry" placeholder="Enter the Country part of your company's registered business address" size="50">
295 </select>
296 </td>
297 </tr>
298 <th colspan = "2">
299 <b>Your Contact Information</b>
300 </th>
301 <tr>
302 <td align="left" class="style1">Title:</td>
303 <td class="style1">
304 <input type="text" id="title" name="title" placeholder="Enter your title (Ms, Mr, Dr, etc)" size="30">
305 </td>
306 </tr>
307 <tr>
308 <td align="left" class="style1">First name:</td>
309 <td class="style1">
310 <input type="text" id="firstname" name="firstname" placeholder="Enter your first name" size="50">
311 </td>
312 </tr>
313 <tr>
314 <td align="left" class="style1">Last name:</td>
315 <td class="style1">
316 <input type="text" id="lastname" name="lastname" placeholder="Enter your surname/family name" size="50">
317 </td>
318 </tr>
319 <tr>
320 <td align="left" class="style1">Preferred name to address you:</td>
321 <td class="style1">
322 <input type="text" id="prefname" name="prefname" placeholder="Enter the name you want to be addressed by" size="50">
323 </td>
324 </tr>
325 <tr>
326 <td align="left" class="style1">Your Role within the company:</td>
327 <td class="style1">
328 <input type="text" id="role" name="role" placeholder="Enter the Role you have within the company" size="70">
329 </td>
330 </tr>
331 <tr>
332 <td align="left" class="style1">Phone number (Landline):</td>
333 <td class="style1">
334 <input type="text" id="lphone" name="lphone" placeholder="Enter your landline phone number, with country code, without symbols" size="70">
335 </td>
336 </tr>
337 <tr>
338 <td align="left" class="style1">Phone number (Mobile):</td>
339 <td class="style1">
340 <input type="text" id="mphone" name="mphone" placeholder="Enter your mobile phone number, with country code, without symbols" size="70">
341 </td>
342 </tr>
343 <tr>
344 <td align="left" class="style1">E-Mail address (primary):</td>
345 <td class="style1">
346 <input type="email" id="email" name="email" placeholder="Enter your primary e-mail address, usually the company e-mail address" size="70">
347 </td>
348 </tr>
349 <tr>
350 <td align="left" class="style1">E-Mail address (secondary):</td>
351 <td class="style1">
352 <input type="email" id="email2" name="email2" placeholder="Enter a secondary e-mail address, in case the primary one becomes unavailable" size="80">
353 </td>
354 </tr>
355 <tr>
356 <td></td>
357 <td align="left" class="style1">
358 <input class="btn btn-primary" type="submit" name="butAction" value="Proceed">
359 </td>
360 </tr>
361 </table>
362 </form>
363 {{/html}}
364 #end
365 #if( $xcontext.strFormStatus == "DataCorrection" )
366 {{html wiki=false clean=false}}
367 <form action="" class="xformInline" method="post" name="User Registration Form">
368 <table id="cecTable"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
369 <col style="width:30%">
370 <col style="width:70%">
371 <th colspan = "2">
372 <b>Company Information</b>
373 </th>
374 <tr>
375 <td align="left" class="style1">Company name:</td>
376 <td class="style1">
377 <input type="text" id="companyname" name="companyname" placeholder="Enter the legal name of your company" value="${xcontext.strCompanyName}" size="50">
378 </select>
379 </td>
380 </tr>
381 <tr>
382 <td align="left" class="style1">Registered Business Address - House Number, Street:</td>
383 <td class="style1">
384 <input type="text" id="companyaddress" name="companyaddress" placeholder="Enter the House Number, Street, Floor, etc part of your company's registered business address" size="100">
385 </select>
386 </td>
387 </tr>
388 <tr>
389 <td align="left" class="style1">Registered Business Address - City:</td>
390 <td class="style1">
391 <input type="text" id="companycity" name="companycity" placeholder="Enter the City part of your company's registered business address" size="100">
392 </select>
393 </td>
394 </tr>
395 <tr>
396 <td align="left" class="style1">Registered Business Address - Postal Code:</td>
397 <td class="style1">
398 <input type="text" id="companypostcode" name="companypostcode" placeholder="Enter the Postal Code part of your company's registered business address" size="100">
399 </select>
400 </td>
401 </tr>
402 <tr>
403 <td align="left" class="style1">Registered Business Address - Province or State:</td>
404 <td class="style1">
405 <input type="text" id="companyprovince" name="companyprovince" placeholder="Enter the Province or State part of your company's registered business address, leave empty if n/a" size="100">
406 </select>
407 </td>
408 </tr>
409 <tr>
410 <td align="left" class="style1">Registered Business Address - Country:</td>
411 <td class="style1">
412 <input type="text" id="companycountry" name="companycountry" placeholder="Enter the Country part of your company's registered business address" size="50">
413 </select>
414 </td>
415 </tr>
416 <th colspan = "2">
417 <b>Your Contact Information</b>
418 </th>
419 <tr>
420 <td align="left" class="style1">Title:</td>
421 <td class="style1">
422 <input type="text" id="title" name="title" placeholder="Enter your title" value="${xcontext.strTitle}" size="20">
423 </td>
424 </tr>
425 <tr>
426 <td align="left" class="style1">First name:</td>
427 <td class="style1">
428 <input type="text" id="firstname" name="firstname" placeholder="Enter your first name" value="${xcontext.strFirstname}" size="50">
429 </td>
430 </tr>
431 <tr>
432 <td align="left" class="style1">Last name:</td>
433 <td class="style1">
434 <input type="text" id="lastname" name="lastname" placeholder="Enter your surname/family name" value="${xcontext.strLastname}" size="50">
435 </td>
436 </tr>
437 <tr>
438 <td align="left" class="style1">Preferred name to address you:</td>
439 <td class="style1">
440 <input type="text" id="prefname" name="prefname" placeholder="Enter the name you want to be addressed by" value="${xcontext.strPrefname}" size="50">
441 </td>
442 </tr>
443 <tr>
444 <td align="left" class="style1">Phone number (Landline):</td>
445 <td class="style1">
446 <input type="text" id="lphone" name="lphone" placeholder="Enter your landline phone number, with country code, without symbols" value="${xcontext.strLphone}" size="70">
447 </td>
448 </tr>
449 <tr>
450 <td align="left" class="style1">Phone number (Mobile):</td>
451 <td class="style1">
452 <input type="text" id="mphone" name="mphone" placeholder="Enter your mobile phone number, with country code, without symbols" value="${xcontext.strMphone}" size="70">
453 </td>
454 </tr>
455 <tr>
456 <td align="left" class="style1">E-Mail address (primary):</td>
457 <td class="style1">
458 <input type="email" id="email" name="email" placeholder="Enter your primary e-mail address, usually the company e-mail address" value="${xcontext.strEmail}" size="70">
459 </td>
460 </tr>
461 <tr>
462 <td align="left" class="style1">E-Mail address (secondary):</td>
463 <td class="style1">
464 <input type="email" id="email2" name="email2" placeholder="Enter a secondary e-mail address, in case the primary one becomes unavailable" value="${xcontext.strEmail2}" size="70">
465 </td>
466 </tr>
467 <tr>
468 <td></td>
469 <td align="left" class="style1">
470 <input class="btn btn-primary" type="submit" name="butAction" value="Proceed">
471 </td>
472 </tr>
473 </table>
474 </form>
475 {{/html}}
476 #end
477
478 #if( $xcontext.strFormStatus == "DataVerify" )
479 You have entered the following information to register to the CEC Scheme:
480 {{html wiki=false clean=false}}
481 <form action="" class="xformInline" method="post" name="User Registration Form">
482 <table id="table1"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
483 <col style="width:30%">
484 <col style="width:70%">
485 <tr>
486 <td align="left" class="style1">Company name:</td>
487 <td class="style1">
488 <input type="hidden" id="companyname" name="companyname" readonly value="${xcontext.strCompanyName}" size="50">
489 ${xcontext.strCompanyName}
490 </td>
491 </tr>
492 <tr>
493 <td align="hidden" class="style1">Title:</td>
494 <td class="style1">
495 <input type="hidden" id="title" name="title" readonly value="${xcontext.strTitle}" size="10">
496 ${xcontext.strTitle}
497 </td>
498 </tr>
499 <tr>
500 <td align="hidden" class="style1">First name:</td>
501 <td class="style1">
502 <input type="hidden" id="firstname" name="firstname" readonly value="${xcontext.strFirstname}" size="50">
503 ${xcontext.strFirstname}
504 </td>
505 </tr>
506 <tr>
507 <td align="hidden" class="style1">Last name:</td>
508 <td class="style1">
509 <input type="hidden" id="lastname" name="lastname" readonly value="${xcontext.strLastname}" size="50">
510 ${xcontext.strLastname}
511 </td>
512 </tr>
513 <tr>
514 <td align="hidden" class="style1">Preferred name to address you:</td>
515 <td class="style1">
516 <input type="hidden" id="prefname" name="prefname" readonly value="${xcontext.strPrefname}" size="50">
517 ${xcontext.strPrefname}
518 </td>
519 </tr>
520 <tr>
521 <td align="left" class="style1">Phone number (Landline):</td>
522 <td class="style1">
523 <input type="hidden" id="lphone" name="lphone" readonly value="${xcontext.strLphone}" size="20">
524 ${xcontext.strLphone}
525 </td>
526 </tr>
527 <tr>
528 <td align="left" class="style1">Phone number (Mobile):</td>
529 <td class="style1">
530 <input type="hidden" id="mphone" name="mphone" readonly value="${xcontext.strMphone}" size="20">
531 ${xcontext.strMphone}
532 </td>
533 </tr>
534 <tr>
535 <td align="left" class="style1">E-Mail address (primary):</td>
536 <td class="style1">
537 <input type="hidden" id="email" name="email" readonly value="${xcontext.strEmail}" size="40">
538 ${xcontext.strEmail}
539 </td>
540 </tr>
541 <tr>
542 <td align="left" class="style1">E-Mail address (secondary):</td>
543 <td class="style1">
544 <input type="hidden" id="email2" name="email2" readonly value="${xcontext.strEmail2}" size="40">
545 ${xcontext.strEmail2}
546 </td>
547 </tr>
548 <tr>
549 <td>Click the button to the right to correct the above information</td>
550 <td align="left" class="style1">
551 <input class="btn btn-default" type="submit" name="butAction" value="Correct">
552 </td>
553 </tr>
554 </table>
555
556 <p>Please check the above information, and if correct, then read the terms and conditions below. If the above information is correct and you accept the terms and conditions, then please click the Register button at the bottom of this page.</p>
557 <p>If the information shown in the above table is incorrect, then please click the "Correct" button at the bottom of the above table to return to the editing page.</p>
558 <p><b>By clicking on the Register button, you agree to the following:</b>
559 <ul>
560 <li>The CEC Scheme, the CEC Website (cecocert.com), and the underlying computer systems are owned and operated by TruCert Assessment Services Inc. ("TruCert"), a company incorporated in Canada.</li>
561 <li>The information you enter into any form on the CEC Website may be stored and retained by TruCert and used for the purposes of the CEC Scheme.</li>
562 <li>Your IP address and time and date of you accessing the CEC Website may be stored and retained by TruCert and used for purposes of the CEC Scheme.</li>
563 <li>The primary computer systems used to store your information are located in Canada. TruCert may operate additional computer systems in the USA, the UK, or the EU that may store copies of your information.</li>
564 <li>By providing your contact information, you agree to TruCert contacting you, and communicating with you for the purposes of the CEC Scheme.</li>
565 <li>By providing your contact information, you agree to TruCert sharing your contact information and the fact that you intend in participating in the CEC Scheme to Mastercard International.</li>
566 <li>By providing your contact information, you agree to TruCert informing 3rd parties participating in the CEC Scheme of the fact that you are also participating in the CEC Scheme, for example by listing your contact information in a register of companies participating in the CEC Scheme.</li>
567 <li>TruCert will not sell, nor make available for free, your contact information for marketing or sales purposes of thirdy parties.</li>
568 <li>TruCert may change the terms and conditons of storing and sharing your contact information, but in such case will inform you of the modified terms and conditions by e-mail and will give you the option to have your contact information deleted before the modified terms and conditions come into force.</li>
569 </ul>
570 <p>After you click the below <b>Register</b> button, you should receive an automatically generated e-mail to the primary e-mail address you provide in the form above, containing a verification link. You must verify your e-mail address by clicking this verification link contained in the e-mail within 24 hours, otherwise your data may be deleted and you will have to restart the registration process.</p>
571
572 <input type="hidden" id="companyname" name="companyname" readonly value="${xcontext.strCompanyName}" size="50">
573
574 <input type="hidden" id="companycity" name="companycity" readonly value="${xcontext.strCompanyAddress}" size="100">
575 <input type="hidden" id="companyaddress" name="companyaddress" readonly value="${xcontext.strCompanyCity}" size="100">
576 <input type="hidden" id="companypostcode" name="companypostcode" readonly value="${xcontext.strCompanyPostcode}" size="100">
577 <input type="hidden" id="companyprovince" name="companyprovince" readonly value="${xcontext.strCompanyProvince}" size="100">
578 <input type="hidden" id="companycountry" name="companycountry" readonly value="${xcontext.strCompanyCountry}" size="50">
579
580 <input type="hidden" id="title" name="title" readonly value="${xcontext.strTitle}" size="10">
581 <input type="hidden" id="firstname" name="firstname" readonly value="${xcontext.strFirstname}" size="50">
582 <input type="hidden" id="lastname" name="lastname" readonly value="${xcontext.strLastname}" size="50">
583 <input type="hidden" id="prefname" name="prefname" readonly value="${xcontext.strPrefname}" size="50">
584 <input type="hidden" id="lphone" name="lphone" readonly value="${xcontext.strLphone}" size="20">
585 <input type="hidden" id="mphone" name="mphone" readonly value="${xcontext.strMphone}" size="20">
586 <input type="hidden" id="email" name="email" readonly value="${xcontext.strEmail}" size="40">
587 <input type="hidden" id="email2" name="email2" readonly value="${xcontext.strEmail2}" size="40">
588 <input class="btn btn-primary" type="submit" name="butAction" value="Register">
589 </form>
590 {{/html}}
591
592 #end
593 #if( $xcontext.strFormStatus == "SendEmail" )
594 #set($email_to = "${xcontext.strEmail}")
595 #set($email_subject = "CEC Registration - confirmation required to proceed")
596 #set($email_from = "cec_noreply@cecocert.com")
597 #set($email_text = "$xcontext.strEmailBody")
598 #set ($message = $services.mail.sender.createMessage($email_from, $email_to, $email_subject))
599 #set ($discard = $message.addPart("text/plain", ${xcontext.strEmailBody}))
600 #set ($mailResult = $services.mail.sender.send($message))
601 ## Check if the message was created properly and if we have permissions to send emails
602 #if ($services.mail.sender.lastError)
603 {{error}}$exceptiontool.getStackTrace($services.mail.sender.lastError){{/error}}
604 #end
605 ## Check if the mail we tried to send has failed to be sent
606 #set ($statuses = $mailResult.statusResult.getAllErrors())
607 #if ($statuses.hasNext())
608 #set ($status = $statuses.next())
609 {{error}}
610 Error: $status.errorSummary ($status.state)
611 $status.errorDescription
612 {{/error}}
613 #end
614 An e-mail asking you to confirm your e-mail address was sent to ${xcontext.strEmail}.
615 Please check your inbox and click on the link to confirm your e-mail address!
616 The process will only continue after you have confirmed your e-mail address.
617 #end
618
619 {{/velocity}}
620
© 2022 TruCert Assessment Services Inc.
V01-00