Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

feature: add notification emails #23

Merged
merged 9 commits into from
Mar 14, 2023

Conversation

itsmostafa
Copy link
Contributor

@itsmostafa itsmostafa commented Mar 8, 2023

Send notification emails endpoint

πŸ—£ Description

Send notification emails for Cycle and Status reports
Initialize manager for Mailgun

πŸ’­ Motivation and context

πŸ§ͺ Testing

tested locally

βœ… Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

func GetNotification(TaskName string) (Notification, error) {
var n Notification
err := db.NotificationsCollection.
FindOne(db.Ctx, bson.D{{Key: "task_name", Value: TaskName}}).

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources

This query depends on a [user-provided value](1).
aws/ses.go Outdated
log.Println("Email sent: ", *output.MessageId)

// Delete attachment
os.Remove(e.FileName)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
// generatePDF generates a pdf file from the API
func generatePDF(pdfFileName, cycleId, taskType string) error {

out, err := os.Create(pdfFileName)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
log.Println("Email sent: ", *output.MessageId)

// Delete attachment
os.Remove(e.FileName)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
@itsmostafa itsmostafa marked this pull request as ready for review March 14, 2023 15:20
@itsmostafa itsmostafa requested a review from izzy64 as a code owner March 14, 2023 15:20
Copy link
Contributor

@izzy64 izzy64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@itsmostafa itsmostafa merged commit 7adcff2 into develop Mar 14, 2023
@itsmostafa itsmostafa deleted the feature/add-notification-emails branch March 14, 2023 15:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants