Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
I
Internship-uksw-2019 api-document-management
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Internship UKSW 2019
Internship-uksw-2019 api-document-management
Commits
90d53805
Commit
90d53805
authored
Mar 20, 2020
by
Internship UKSW 2019
Browse files
Options
Browse Files
Download
Plain Diff
Initial commit
parents
9770f8b4
0cac4453
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
API.js
routes/API.js
+10
-3
No files found.
routes/API.js
View file @
90d53805
...
@@ -15,22 +15,28 @@ const sendEmail = (request, response) => {
...
@@ -15,22 +15,28 @@ const sendEmail = (request, response) => {
`
`
let
transporter
=
nodemailer
.
createTransport
({
let
transporter
=
nodemailer
.
createTransport
({
host
:
'smtp.gmail.com'
,
host
:
'smtp.gmail.com'
,
port
:
465
,
secure
:
true
,
auth
:
{
auth
:
{
user
:
'vdocmanagement@gmail.com'
,
user
:
'vdocmanagement@gmail.com'
,
pass
:
'docmgmt123'
pass
:
'docmgmt123'
},
},
//proxy: 'http://10.194.194.2:8080'
//
proxy: 'http://10.194.194.2:8080'
})
})
let
maillist
=
[
emailsend
]
maillist
.
forEach
(
function
(
to
,
i
,
array
)
{
let
mailOptions
=
{
let
mailOptions
=
{
from
:
'vdocmanagement@gmail.com'
,
from
:
'vdocmanagement@gmail.com'
,
to
:
emailsend
,
cc
:
emailcc
,
cc
:
emailcc
,
subject
:
subject
,
subject
:
subject
,
text
:
message
,
text
:
message
,
html
:
htmlEmail
html
:
htmlEmail
}
}
mailOptions
.
to
=
to
;
transporter
.
sendMail
(
mailOptions
,
(
error
,
info
)
=>
{
transporter
.
sendMail
(
mailOptions
,
(
error
,
info
)
=>
{
if
(
err
)
{
if
(
err
)
{
throw
error
throw
error
...
@@ -40,6 +46,7 @@ const sendEmail = (request, response) => {
...
@@ -40,6 +46,7 @@ const sendEmail = (request, response) => {
response
.
status
(
200
).
json
({
status
:
'success'
,
message
:
'Email has been sent'
})
response
.
status
(
200
).
json
({
status
:
'success'
,
message
:
'Email has been sent'
})
})
})
})
})
})
}
}
const
getDocument
=
(
request
,
response
)
=>
{
const
getDocument
=
(
request
,
response
)
=>
{
...
...
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