Skip to content

Commit

Permalink
Hook the templates up
Browse files Browse the repository at this point in the history
  • Loading branch information
wasade committed Jul 30, 2020
1 parent cac942f commit 885bbe7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions microsetta_private_api/admin/email_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ class EmailMessage(Enum):
EventType.EMAIL,
EventSubtype.EMAIL_MISSING_SAMPLE_INFO
)
sample_is_valid = (
"Sample is valid",
"email/sample_is_valid.jinja2",
"email/sample_is_valid.plain",
("contact_name", "sample_barcode", "received_type", "resolution_url"),
EventType.EMAIL,
EventSubtype.EMAIL_SAMPLE_IS_VALID
)
no_associated_source = (
"No associated source",
"email/no_associated_source.jinja2",
"email/no_associated_source.plain",
("contact_name", "sample_barcode", "received_type", "resolution_url"),
EventType.EMAIL,
EventSubtype.EMAIL_NO_SOURCE
)

def __init__(self, subject, html, plain, required, event_type, event_sub):
self.subject = subject
Expand Down
4 changes: 4 additions & 0 deletions microsetta_private_api/model/log_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class EventSubtype(Enum):
EMAIL_INCORRECT_SAMPLE_TYPE = "incorrect_sample_type"
# Indicate a sample was received but necessary information was not provided
EMAIL_MISSING_SAMPLE_INFO = "missing_sample_info"
# A valid sample was received
EMAIL_SAMPLE_IS_VALID = "sample_is_valid"
# Sample is not associated with a source
EMAIL_NO_SOURCE = "no_associated_source"


class LogEvent(ModelBase):
Expand Down

0 comments on commit 885bbe7

Please sign in to comment.