-
-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
385 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
. .o8 oooo | ||
.o8 "888 `888 | ||
.o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo | ||
888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' | ||
888 888 888 888 888 888 888ooo888 `"Y88b. 888888. | ||
888 . 888 888 888 888 888 888 .o o. )88b 888 `88b. | ||
"888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o | ||
======================================================================== | ||
Created: 11/06/2015 | ||
Author: Chris Brame | ||
**/ | ||
|
||
var async = require('async'); | ||
var path = require('path'); | ||
var _ = require('underscore'); | ||
var _s = require('underscore.string'); | ||
var flash = require('connect-flash'); | ||
var userSchema = require('../models/user'); | ||
var reports = require('../models/report'); | ||
var permissions = require('../permissions'); | ||
var mongoose = require('mongoose'); | ||
var winston = require('winston'); | ||
|
||
var debugController = {}; | ||
|
||
debugController.content = {}; | ||
|
||
debugController.sendmail = function(req, res, next) { | ||
var mailer = require('../mailer'); | ||
var emailTemplates = require('email-templates'); | ||
var templateDir = path.resolve(__dirname, '..', 'mailer', 'templates'); | ||
|
||
emailTemplates(templateDir, function(err, template) { | ||
if (err) { | ||
winston.error(err); | ||
} else { | ||
|
||
template('ticket-updated', function(err, html) { | ||
if (err) { | ||
winston.error(err); | ||
} else { | ||
var mailOptions = { | ||
from: 'no-reply@trudesk.io', | ||
to: 'chris.brame@granvillecounty.org', | ||
subject: 'Trudesk Launch', | ||
html: html, | ||
generateTextFromHTML: true | ||
}; | ||
|
||
mailer.sendMail(mailOptions, function(err, info) { | ||
if (err) { | ||
winston.warn(err); | ||
return res.send(err); | ||
} | ||
|
||
|
||
return res.status(200).send('OK'); | ||
}); | ||
} | ||
}); | ||
} | ||
}); | ||
}; | ||
|
||
function handleError(res, err) { | ||
if (err) { | ||
return res.render('error', {layout: false, error: err, message: err.message}); | ||
} | ||
} | ||
|
||
module.exports = debugController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Updated: Ticket #{{ticket.uid}}</title> | ||
<style> | ||
h1,h2,h3,h4,h5,h6 { | ||
margin-bottom: 2px; | ||
} | ||
hr { | ||
display: block; | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
background: #ccc; | ||
height: 3px; | ||
border: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<h2>Updated: {{{ticket.subject}}}</h2> | ||
<h5>Ticket Group: {{ticket.group.name}}</h5> | ||
<h5>Ticket Submitted by: {{ticket.owner.fullname}}</h5> | ||
<h5>Submitted Date: {{ticket.date}}</h5> | ||
<h5>Ticket Type: {{ticket.type.name}}</h5> | ||
<h5>Ticket Priority: {{ticket.priority}}</h5> | ||
<h5>Tags: {{ticket.tags}}</h5> | ||
|
||
<br/><br/> | ||
<h4>Ticket Issue</h4> | ||
<hr/> | ||
<p class="issue">{{{ticket.issue}}}</p> | ||
|
||
<br/><br/> | ||
<h4>Comments</h4> | ||
<hr/> | ||
{{#each ticket.comments}} | ||
<h5>{{owner.fullname}}</h5> | ||
<h5>{{date}}</h5> | ||
<br/> | ||
<p class="issue">{{{comment}}}</p> | ||
<br/> | ||
<hr/> | ||
{{/each}} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Ticket #{{ticket.uid}}</title> | ||
<style> | ||
h1,h2,h3,h4,h5,h6 { | ||
margin-bottom: 2px; | ||
} | ||
hr { | ||
display: block; | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
background: #ccc; | ||
height: 3px; | ||
border: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<h2>{{{ticket.subject}}}</h2> | ||
<h5>Ticket Group: {{ticket.group.name}}</h5> | ||
<h5>Ticket Submitted by: {{ticket.owner.fullname}}</h5> | ||
<h5>Submitted Date: {{ticket.date}}</h5> | ||
<h5>Ticket Type: {{ticket.type.name}}</h5> | ||
<h5>Ticket Priority: {{ticket.priority}}</h5> | ||
<h5>Tags: {{ticket.tags}}</h5> | ||
|
||
<br/><br/> | ||
<h4>Ticket Issue</h4> | ||
<hr/> | ||
<p class="issue">{{{ticket.issue}}}</p> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.