Commit a0272770 authored by Hasitha Samarasekara's avatar Hasitha Samarasekara

Sign up email set done

parent 9a75fd43
...@@ -10,7 +10,7 @@ const userSchema = new Schema({ ...@@ -10,7 +10,7 @@ const userSchema = new Schema({
user_type:{type:String,required:true}, user_type:{type:String,required:true},
confirmed: { confirmed: {
type: Boolean, type: Boolean,
default: false default: true
} }
}); });
......
...@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{ ...@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{
.then(newUser =>{ .then(newUser =>{
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
const content = ` // const content = `
Hi ${institute_name},\n // Hi ${institute_name},\n
You are Create a Institute Account on SmartCoach.\n // You are Create a Institute Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}' // You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
Used institute email address as the username : ${user_email} // Used institute email address as the username : ${user_email}
Used given password as the password // Used given password as the password
Thank You, // Thank You,
Team SmartCoach // Team SmartCoach
`; // `;
//
var mail = { // var mail = {
from: institute_name, // from: institute_name,
to: user_email, // to: user_email,
subject: 'Email Verification - Institute', // subject: 'Email Verification - Institute',
text: content // text: content
} // }
//
transporter.sendMail(mail, (err, data) => { // transporter.sendMail(mail, (err, data) => {
if (err) { // if (err) {
res.json({ // res.json({
msg: 'fail' // msg: 'fail'
}) // })
} else { // } else {
res.json({ // res.json({
msg: 'success' // msg: 'success'
}) // })
} // }
}) // })
; // ;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
}) })
......
...@@ -89,68 +89,68 @@ router.route('/add').post( async(req,res) =>{ ...@@ -89,68 +89,68 @@ router.route('/add').post( async(req,res) =>{
.then(newUser =>{ .then(newUser =>{
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
const content = ` // const content = `
Hi ${student_name},\n // Hi ${student_name},\n
You are Create a Student Account on SmartCoach.\n // You are Create a Student Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}' // You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
Used your email address as the username : ${user_email} // Used your email address as the username : ${user_email}
Used given password as the password // Used given password as the password
Thank You, // Thank You,
Team SmartCoach // Team SmartCoach
`; // `;
//
var mail = { // var mail = {
from: student_name, // from: student_name,
to: user_email, // to: user_email,
subject: 'Email Verification - Student', // subject: 'Email Verification - Student',
text: content // text: content
} // }
//
transporter.sendMail(mail, (err, data) => { // transporter.sendMail(mail, (err, data) => {
if (err) { // if (err) {
res.json({ // res.json({
msg: 'fail' // msg: 'fail'
}) // })
} else { // } else {
res.json({ // res.json({
msg: 'success' // msg: 'success'
}) // })
} // }
}) // })
; // ;
//
//
const content_guardian = ` // const content_guardian = `
Hi ${guardian_name},\n // Hi ${guardian_name},\n
Your student ${student_name} is Create a Student Account on SmartCoach.\n // Your student ${student_name} is Create a Student Account on SmartCoach.\n
//
You can know student progress through the email. // You can know student progress through the email.
We will send Student attendance, Quiz marks, Assignment Marks and other details through this email. // We will send Student attendance, Quiz marks, Assignment Marks and other details through this email.
//
Thank You, // Thank You,
Team SmartCoach // Team SmartCoach
`; // `;
//
var mail_guardian = { // var mail_guardian = {
from: guardian_name, // from: guardian_name,
to: guardian_email, // to: guardian_email,
subject: 'Student Information on SmartCoach', // subject: 'Student Information on SmartCoach',
text: content_guardian // text: content_guardian
} // }
//
transporter.sendMail(mail_guardian, (err, data) => { // transporter.sendMail(mail_guardian, (err, data) => {
if (err) { // if (err) {
res.json({ // res.json({
msg: 'fail' // msg: 'fail'
}) // })
} else { // } else {
res.json({ // res.json({
msg: 'success' // msg: 'success'
}) // })
} // }
}) // })
; // ;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
}) })
......
...@@ -35,7 +35,7 @@ router.route('/').get((req,res) =>{ ...@@ -35,7 +35,7 @@ router.route('/').get((req,res) =>{
router.route('/add').post(async(req,res) =>{ router.route('/add').post(async(req,res) =>{
console.log("Tutor Registration began")
const tutor_name = req.body.tutor_name; const tutor_name = req.body.tutor_name;
const tutor_nic = req.body.tutor_nic; const tutor_nic = req.body.tutor_nic;
const tutor_email = req.body.tutor_email; const tutor_email = req.body.tutor_email;
...@@ -105,35 +105,35 @@ router.route('/add').post(async(req,res) =>{ ...@@ -105,35 +105,35 @@ router.route('/add').post(async(req,res) =>{
.then(newUser =>{ .then(newUser =>{
console.log("Inside the Email Send part") console.log("Inside the Email Send part")
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
const content = ` // const content = `
Hi ${tutor_name},\n // Hi ${tutor_name},\n
You are Create a Tutor Account on SmartCoach.\n // You are Create a Tutor Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}' // You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
Used your email address as username : ${user_email} // Used your email address as username : ${user_email}
Thank You, // Thank You,
Team SmartCoach // Team SmartCoach
`; // `;
//
var mail = { // var mail = {
from: tutor_name, // from: tutor_name,
to: user_email, // to: user_email,
subject: 'Email Verification - Tutor', // subject: 'Email Verification - Tutor',
text: content // text: content
} // }
//
transporter.sendMail(mail, (err, data) => { // transporter.sendMail(mail, (err, data) => {
if (err) { // if (err) {
res.json({ // res.json({
msg: 'fail' // msg: 'fail'
}) // })
} else { // } else {
res.json({ // res.json({
msg: 'success' // msg: 'success'
}) // })
} // }
}) // })
; // ;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
}) })
......
...@@ -9,6 +9,7 @@ import Star from "../Images/star.png"; ...@@ -9,6 +9,7 @@ import Star from "../Images/star.png";
import ReviewImg from "../Images/note.png"; import ReviewImg from "../Images/note.png";
import Calender from "../Images/calender.png"; import Calender from "../Images/calender.png";
import StarBackGround from "../Images/starboarder.png"; import StarBackGround from "../Images/starboarder.png";
import ItemNav from "./Navbar";
export default class Home extends Component{ export default class Home extends Component{
constructor(props) { constructor(props) {
...@@ -62,8 +63,16 @@ export default class Home extends Component{ ...@@ -62,8 +63,16 @@ export default class Home extends Component{
render() { render() {
return ( return (
<div className="App" style={{padding:'10px',paddingTop:'0px'}}> <div className="App" style={{padding:'10px',paddingTop:'0px'}}>
<div>
</div>
<div className="row" style={{width:'100%'}}>
<ItemNav/>
</div>
<div className="row"> <div className="row">
<img src={MianImage} style={{width:'100%', height:'250px'}}/> <img src={MianImage} style={{width:'100%', height:'250px'}}/>
</div> </div>
<div className="row" style={{marginRight:'50px', marginLeft:'50px', padding:'5px',background:'#1E4258'}}> <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'}}> <div className="col-4" style={{margin:'5px', border:'solid', padding:'10px', borderColor:'#216E9B'}}>
......
...@@ -494,6 +494,12 @@ export default class SignUp extends Component { ...@@ -494,6 +494,12 @@ export default class SignUp extends Component {
guardian_email : '', guardian_email : '',
guardian_relationship : '', guardian_relationship : '',
isConditionChecked : false, isConditionChecked : false,
institutePhoneNoOnChange : '',
tempInstitutePhoneList : '',
InstituteApartment : '',
InstituteStreet : '',
InstituteCity : '',
}) })
...@@ -605,7 +611,7 @@ export default class SignUp extends Component { ...@@ -605,7 +611,7 @@ export default class SignUp extends Component {
if (error.response) { if (error.response) {
// The request was made and the server responded with a status code // The request was made and the server responded with a status code
// that falls out of the range of 2xx // 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.status);
//console.log(error.response.headers); //console.log(error.response.headers);
...@@ -645,7 +651,7 @@ export default class SignUp extends Component { ...@@ -645,7 +651,7 @@ export default class SignUp extends Component {
} }
this.SetToDefault();
console.log(institute); console.log(institute);
axios.post(configs.BASE_URL + '/instituteSingUp/add', institute) axios.post(configs.BASE_URL + '/instituteSingUp/add', institute)
......
import React, {Component} from "react"; import React, {Component} from "react";
import ItemNav from "./Navbar"; import ItemNav from "./Navbar";
import ConfirmEmail from "../Images/confirmemail.png"; import ConfirmEmail from "../Images/confirmemail.png";
import axios from "axios";
import * as configs from "../Config/config";
export default class beforeConfirmation extends Component{ export default class beforeConfirmation extends Component{
...@@ -8,12 +10,65 @@ export default class beforeConfirmation extends Component{ ...@@ -8,12 +10,65 @@ export default class beforeConfirmation extends Component{
super(props); super(props);
this.state = { 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() { render() {
return ( return (
...@@ -29,6 +84,12 @@ export default class beforeConfirmation extends Component{ ...@@ -29,6 +84,12 @@ export default class beforeConfirmation extends Component{
<div className="row" style={{padding: '40px'}}> <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> <span>Your Account has been successfully registered. To complete the process please check your email for a validation request</span>
</div> </div>
{/*<form onSubmit={this.onSubmitStudent}>*/}
{/* <div className="row" style={{padding: '40px'}}>*/}
{/* <button type="submit" className="btn btn-primary">Register</button>*/}
{/* </div>*/}
{/*</form>*/}
</div> </div>
</div> </div>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment