Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'feature-rewardsSystem' into emailUtils
  • Loading branch information
krogers78 authored Mar 19, 2018
commit 315b0f3c31ea854fc145c84bb80a0f8737ae93b1
2 changes: 1 addition & 1 deletion bot/botUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ exports.welcomeCommand = async (member) => {
await member.send(welcomeString);
};


// Nodemailer email function
// Set up Nodemailer to send emails through gmail
exports.sendEmail = async (message, toEmailAdd, emailSubject,
Expand Down Expand Up @@ -118,3 +117,4 @@ exports.sendEmail = async (message, toEmailAdd, emailSubject,
});
return null;
};
exports.validDomains = ['student.fullsail.edu', 'fullsail.edu', 'fullsail.com'];
9 changes: 4 additions & 5 deletions bot/controllers/invite.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const BaseController = require('../baseController.js');
const Command = require('../baseCommand.js');
const util = require('apex-util');
const { getUserPointsandUpdate, sendEmail } = require('../botUtils');

const { getUserPointsandUpdate, sendEmail, validDomains } = require('../botUtils');

class inviteController extends BaseController {
constructor(message) {
Expand Down Expand Up @@ -47,15 +46,15 @@ class inviteController extends BaseController {
const emailBodyString = `<table><tr><td><p>Please follow this link to be included in the discord <a href=${invite.url}>link</a> Thank you for your interest for wanting to be in the Discord enjoy.</p></td></tr></table>`;
sendEmail(message, email, emailSubject, emailBodyString, emailType, (sendStatus) => {
if (sendStatus) {
const numPointToAdd = 1;
getUserPointsandUpdate(message.author.id, numPointToAdd);
getUserPointsandUpdate(message.author.id, invitePointsAwarded);
message.author.send(`You've received ${invitePointsAwarded} point(s) for sending this invite.`);
}
});
} else {
message.author.send('Sorry the invite could not be sent please contact a admin for assistance.');
}
});
return `${message.author}, Invite Status: `;
return `${message.author}, invite status:`;
}
}

Expand Down
3 changes: 1 addition & 2 deletions bot/controllers/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const Command = require('../baseCommand.js');
const util = require('apex-util');
const models = require('../../db/models');
const uuidv4 = require('uuid/v4');
const { sendEmail } = require('../botUtils');
const { generateCode } = require('../botUtils.js');
const { generateCode, validDomains, sendEmail } = require('../botUtils.js');

class VerifyController extends BaseController {
constructor(message) {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.