Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-049
2021-049
Commits
a0272770
Commit
a0272770
authored
Aug 21, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sign up email set done
parent
9a75fd43
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
201 additions
and
125 deletions
+201
-125
BackEnd/WebBackEnd/models/userAccount.user.model.js
BackEnd/WebBackEnd/models/userAccount.user.model.js
+1
-1
BackEnd/WebBackEnd/routes/institute.route.js
BackEnd/WebBackEnd/routes/institute.route.js
+30
-30
BackEnd/WebBackEnd/routes/student.route.js
BackEnd/WebBackEnd/routes/student.route.js
+62
-62
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+30
-30
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+9
-0
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
+8
-2
WebFrontEnd/smartcoach-frontend/src/Components/beforeConfirmation.js
.../smartcoach-frontend/src/Components/beforeConfirmation.js
+61
-0
No files found.
BackEnd/WebBackEnd/models/userAccount.user.model.js
View file @
a0272770
...
...
@@ -10,7 +10,7 @@ const userSchema = new Schema({
user_type
:{
type
:
String
,
required
:
true
},
confirmed
:
{
type
:
Boolean
,
default
:
fals
e
default
:
tru
e
}
});
...
...
BackEnd/WebBackEnd/routes/institute.route.js
View file @
a0272770
...
...
@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{
.
then
(
newUser
=>
{
////////////////////////////////////////////////////////////////////////////////////
const
content
=
`
Hi
${
institute_name
}
,\n
You are Create a Institute Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used institute email address as the username :
${
user_email
}
Used given password as the password
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
institute_name
,
to
:
user_email
,
subject
:
'
Email Verification - Institute
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
//
const content = `
//
Hi ${institute_name},\n
//
You are Create a Institute Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used institute email address as the username : ${user_email}
//
Used given password as the password
//
Thank You,
// Team SmartCoach
//
`;
//
//
var mail = {
//
from: institute_name,
//
to: user_email,
//
subject: 'Email Verification - Institute',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
/////////////////////////////////////////////////////////////////////////////////////
})
...
...
BackEnd/WebBackEnd/routes/student.route.js
View file @
a0272770
...
...
@@ -89,68 +89,68 @@ router.route('/add').post( async(req,res) =>{
.
then
(
newUser
=>
{
////////////////////////////////////////////////////////////////////////////////////
const
content
=
`
Hi
${
student_name
}
,\n
You are Create a Student Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used your email address as the username :
${
user_email
}
Used given password as the password
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
student_name
,
to
:
user_email
,
subject
:
'
Email Verification - Student
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
const
content_guardian
=
`
Hi
${
guardian_name
}
,\n
Your student
${
student_name
}
is Create a Student Account on SmartCoach.\n
You can know student progress through the email.
We will send Student attendance, Quiz marks, Assignment Marks and other details through this email.
Thank You,
Team SmartCoach
`
;
var
mail_guardian
=
{
from
:
guardian_name
,
to
:
guardian_email
,
subject
:
'
Student Information on SmartCoach
'
,
text
:
content_guardian
}
transporter
.
sendMail
(
mail_guardian
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
//
const content = `
//
Hi ${student_name},\n
//
You are Create a Student Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used your email address as the username : ${user_email}
//
Used given password as the password
//
Thank You,
// Team SmartCoach
//
`;
//
//
var mail = {
//
from: student_name,
//
to: user_email,
//
subject: 'Email Verification - Student',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
//
//
//
const content_guardian = `
//
Hi ${guardian_name},\n
//
Your student ${student_name} is Create a Student Account on SmartCoach.\n
//
// You can know student progress through the email.
//
We will send Student attendance, Quiz marks, Assignment Marks and other details through this email.
//
//
Thank You,
// Team SmartCoach
//
`;
//
//
var mail_guardian = {
//
from: guardian_name,
//
to: guardian_email,
//
subject: 'Student Information on SmartCoach',
//
text: content_guardian
//
}
//
//
transporter.sendMail(mail_guardian, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
/////////////////////////////////////////////////////////////////////////////////////
})
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
a0272770
...
...
@@ -35,7 +35,7 @@ router.route('/').get((req,res) =>{
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
console
.
log
(
"
Tutor Registration began
"
)
const
tutor_name
=
req
.
body
.
tutor_name
;
const
tutor_nic
=
req
.
body
.
tutor_nic
;
const
tutor_email
=
req
.
body
.
tutor_email
;
...
...
@@ -105,35 +105,35 @@ router.route('/add').post(async(req,res) =>{
.
then
(
newUser
=>
{
console
.
log
(
"
Inside the Email Send part
"
)
////////////////////////////////////////////////////////////////////////////////////
const
content
=
`
Hi
${
tutor_name
}
,\n
You are Create a Tutor Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used your email address as username :
${
user_email
}
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
tutor_name
,
to
:
user_email
,
subject
:
'
Email Verification - Tutor
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
//
const content = `
//
Hi ${tutor_name},\n
//
You are Create a Tutor Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used your email address as username : ${user_email}
//
Thank You,
// Team SmartCoach
//
`;
//
//
var mail = {
//
from: tutor_name,
//
to: user_email,
//
subject: 'Email Verification - Tutor',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
/////////////////////////////////////////////////////////////////////////////////////
})
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
a0272770
...
...
@@ -9,6 +9,7 @@ import Star from "../Images/star.png";
import
ReviewImg
from
"
../Images/note.png
"
;
import
Calender
from
"
../Images/calender.png
"
;
import
StarBackGround
from
"
../Images/starboarder.png
"
;
import
ItemNav
from
"
./Navbar
"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -62,8 +63,16 @@ export default class Home extends Component{
render
()
{
return
(
<
div
className
=
"
App
"
style
=
{{
padding
:
'
10px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
row
"
>
<
img
src
=
{
MianImage
}
style
=
{{
width
:
'
100%
'
,
height
:
'
250px
'
}}
/
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
padding
:
'
5px
'
,
background
:
'
#1E4258
'
}}
>
<
div
className
=
"
col-4
"
style
=
{{
margin
:
'
5px
'
,
border
:
'
solid
'
,
padding
:
'
10px
'
,
borderColor
:
'
#216E9B
'
}}
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
View file @
a0272770
...
...
@@ -494,6 +494,12 @@ export default class SignUp extends Component {
guardian_email
:
''
,
guardian_relationship
:
''
,
isConditionChecked
:
false
,
institutePhoneNoOnChange
:
''
,
tempInstitutePhoneList
:
''
,
InstituteApartment
:
''
,
InstituteStreet
:
''
,
InstituteCity
:
''
,
})
...
...
@@ -605,7 +611,7 @@ export default class SignUp extends Component {
if
(
error
.
response
)
{
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
//
console.log(error.response.data);
console
.
log
(
error
.
response
.
data
);
//console.log(error.response.status);
//console.log(error.response.headers);
...
...
@@ -645,7 +651,7 @@ export default class SignUp extends Component {
}
this
.
SetToDefault
();
console
.
log
(
institute
);
axios
.
post
(
configs
.
BASE_URL
+
'
/instituteSingUp/add
'
,
institute
)
...
...
WebFrontEnd/smartcoach-frontend/src/Components/beforeConfirmation.js
View file @
a0272770
import
React
,
{
Component
}
from
"
react
"
;
import
ItemNav
from
"
./Navbar
"
;
import
ConfirmEmail
from
"
../Images/confirmemail.png
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
export
default
class
beforeConfirmation
extends
Component
{
...
...
@@ -8,12 +10,65 @@ export default class beforeConfirmation extends Component{
super
(
props
);
this
.
state
=
{
sNameList
:
[
'
Saman Deshapriya
'
,
'
Kamal Perera
'
,
'
asiri Deshapriya
'
,
'
Kelumsiri Perera
'
,
'
sahan Perera
'
,
'
Shaminda Perera
'
,
'
Kelum Perera
'
,
'
Kamal Surawera
'
,
'
damith madushan
'
,
'
kithmal Perera
'
,
'
banuka Perera
'
,
'
Kelumsiri Deshapriya
'
,
'
sahan Deshapriya
'
,
'
Shaminda Rajapaksha
'
,
'
Kelum Rajapaksha
'
,
'
Sunil madushan
'
,
'
kithmal Perera
'
,
'
Sumin Perera
'
,
'
asiri Rajapaksha
'
,
'
banuka Rajapaksha
'
,
'
Shamin Rajapaksha
'
,
'
Kelum Deshapriya
'
,
'
Sunil Akalanka
'
,
'
kithmal Akalanka
'
,
'
Sumin Akalanka
'
,
'
asiri Akalanka
'
,
'
banuka Akalanka
'
,
'
Shamin Akalanka
'
,
'
Kelum Athukorala
'
,
'
Sunil Athukorala
'
,
'
kithmal Athukorala
'
,
'
Sumin Athukorala
'
,
'
asiri Athukorala
'
,
'
banuka Athukorala
'
,
'
Shamin Athukorala
'
,
'
Kelum Pandula
'
,
'
Sunil Pandula
'
,
'
kithmal Pandula
'
,
'
Sumin Pandula
'
,
'
asiri Pandula
'
,
'
banuka Pandula
'
,
'
Shamin Pandula
'
,
'
Nuwan Pandula
'
,
'
Deemantha Pandula
'
,
'
Eashan Yoshitha
'
,
'
Madura Fernando
'
,
'
asiri Fernando
'
,
'
banuka Fernando
'
,
'
Shamin Fernando
'
,
'
Nuwan Fernando
'
,
'
Deemantha Fernando
'
,
'
Eashan Fernando
'
,
'
Madura Perera
'
,
'
Dasun Shanaka
'
,
'
Dinuka Fernando
'
,
'
Amal Fernando
'
],
sNameList2
:
[
'
Hemal Perera
'
,
'
Kithmal weeraraththne
'
,
'
Chaitha Dias
'
],
};
this
.
onSubmitStudent
=
this
.
onSubmitStudent
.
bind
(
this
);
}
onSubmitStudent
(){
let
NIC
=
981617300
;
const
fnameList
=
[
'
Lasitha
'
,
'
Thusitha
'
,
'
Bathika
'
,
'
Sameera
'
,
'
Kalana
'
,
'
Hirusha
'
,
'
Nipuna
'
,
'
Umesh
'
,
'
Rahal
'
,
'
Sachintha
'
,
'
Lasan
'
,
'
Kishara
'
,
'
Rasitha
'
,
'
Yehan
'
,
'
Yenuka
'
,
'
Thisara
'
,
'
Malindu
'
,
'
Milinda
'
,
'
Tharaka
'
,
'
Hansaka
'
,]
const
girlsList
=
[
'
Sammani
'
,
'
Tharaki
'
,
'
Tinali
'
,
'
Shanu
'
,
'
Divyani
'
,
'
Thakshila
'
,
'
Surangi
'
,
'
Sandani
'
,
'
Samadhi
'
,
'
Kavisha
'
,
'
Dilhani
'
,
'
Anusari
'
,
'
Kethaki
'
,
'
Gayathra
'
,
'
Ishanka
'
,
'
Samudhi
'
,
'
Shehani
'
,
'
Tharumini
'
,
'
Kasuni
'
,
'
Kalani
'
]
const
lName
=
'
Kempitiya
'
girlsList
.
map
(
name
=>
{
let
studentNIC
=
NIC
+
'
V
'
;
let
studentName
=
name
+
'
'
+
lName
;
const
res
=
studentName
.
replace
(
/ /g
,
''
)
let
studentEmail
=
res
.
toLowerCase
()
+
'
@gmail.com
'
;
let
studentPsw
=
'
Abc@123
'
;
const
student
=
{
student_name
:
studentName
,
student_nic
:
studentNIC
,
student_email
:
studentEmail
,
student_phone
:
'
0719855824
'
,
student_address
:
'
Colombo
'
,
student_password
:
studentPsw
,
student_gender
:
'
Female
'
,
student_image
:
''
,
guardian_name
:
'
ABC
'
,
guardian_email
:
'
abc@gmail.com
'
,
guardian_relationship
:
'
Mother
'
,
}
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
{
//console.log("Inside Then")
setTimeout
(()
=>
{
console
.
log
(
"
World!
"
);
},
2000
);
})
setTimeout
(()
=>
{
console
.
log
(
"
World!
"
);
},
2000
);
NIC
=
NIC
+
1
;
})
}
render
()
{
return
(
...
...
@@ -29,6 +84,12 @@ export default class beforeConfirmation extends Component{
<
div
className
=
"
row
"
style
=
{{
padding
:
'
40px
'
}}
>
<
span
>
Your
Account
has
been
successfully
registered
.
To
complete
the
process
please
check
your
email
for
a
validation
request
<
/span
>
<
/div
>
{
/*<form onSubmit={this.onSubmitStudent}>*/
}
{
/* <div className="row" style={{padding: '40px'}}>*/
}
{
/* <button type="submit" className="btn btn-primary">Register</button>*/
}
{
/* </div>*/
}
{
/*</form>*/
}
<
/div
>
<
/div
>
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment