-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(HarvestRequests): add requester email to admin notification (#96)
- Loading branch information
1 parent
133683b
commit 6a7f588
Showing
2 changed files
with
5 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,12 +174,13 @@ const sendOERIntRequestConfirmation = (requesterName, recipientAddress, resource | |
* NOTE: Do NOT use this method directly from a Conductor API route. Use internally | ||
* only after proper verification via other internal methods. | ||
* @param {String} requesterName - the requesting user's name ('firstName' or 'firstName lastName') | ||
* @param {String} requesterEmail - the requesting user's email | ||
* @param {String} resourceTitle - the resource's title/name | ||
* @returns {Promise<Object|Error>} a Mailgun API Promise | ||
*/ | ||
const sendOERIntRequestAdminNotif = (requesterName, resourceTitle) => { | ||
let textToSend = `Attention: ${requesterName} has submitted a new OER Integration Request for "${resourceTitle}". This request is available in Conductor.` + autoGenNoticeText; | ||
let htmlToSend = `<p>Attention:</p><p>${requesterName} has submitted a new OER Integration Request for "${resourceTitle}".</p><p>This request is available in Conductor.</p>` + autoGenNoticeHTML; | ||
const sendOERIntRequestAdminNotif = (requesterName, requesterEmail, resourceTitle) => { | ||
let textToSend = `Attention: ${requesterName ? requesterName : requesterEmail} has submitted a new OER Integration Request for "${resourceTitle}". This request is available in Conductor.` + autoGenNoticeText; | ||
let htmlToSend = `<p>Attention:</p><p>${requesterName ? `${requesterName} (${requesterEmail})` : requesterEmail} has submitted a new OER Integration Request for "${resourceTitle}".</p><p>This request is available in Conductor.</p>` + autoGenNoticeHTML; | ||
return mailgun.messages.create(process.env.MAILGUN_DOMAIN, { | ||
from: 'LibreTexts Conductor <[email protected]>', | ||
to: ['[email protected]'], | ||
|