raft-tech / TANF-app

Repo for development of a new TANF Data Reporting System
Other
16 stars 3 forks source link

As a data analyst I want to be notified of approaching data deadlines #2473

Open reitermb opened 1 year ago

reitermb commented 1 year ago

Description: As a data analyst, if I haven't yet submitted my data, I want to be notified when: A deadline is approaching (5 days)

Acceptance Criteria: Create a list of functional outcomes that must be achieved to complete this issue

Tasks: Create a list of granular, specific work items that must be completed to deliver the desired outcomes of this issue

Supporting Documentation: HTML email templates Current email logic used by Alex to do this manually

Notes

ADPennington commented 3 months ago

function currently used to generate email reminder content:

def email_content_generator(today_datetime):
    '''takes todays datetime as input and returns content for data deadline email reminder'''
    current_calyr = today_datetime.year 
    current_mmdd = today_datetime.strftime('%m-%d')

    if current_mmdd <= "02-14":
        fiscal_yr = current_calyr 
        fiscal_qtr = "Q1"
        due_date = "February 14th"
        reporting_period = f"Oct - Dec, {fiscal_yr - 1}"
    elif  "05-15" >= current_mmdd > "02-14":
        fiscal_yr = current_calyr 
        fiscal_qtr = "Q2"
        due_date = "May 15th"
        reporting_period = f"Jan - Mar, {fiscal_yr}"
    elif  "08-14" >= current_mmdd > "05-15":
        fiscal_yr = current_calyr 
        fiscal_qtr = "Q3"
        due_date = "August 14th"
        reporting_period = f"Apr - Jun, {fiscal_yr}"
    else:
        fiscal_yr = current_calyr
        fiscal_qtr = "Q4"
        due_date = "November 14th"
        reporting_period = f"Jul - Sep, {fiscal_yr}"

    email_content = f"""\
        <html>\
        <body>\
        <p>This is a friendly reminder that the deadline for fiscal year (FY) {fiscal_yr} {fiscal_qtr} ({reporting_period}) data submissions \
        is {due_date}, {current_calyr}. </p>\
        <p>For those of you who have already submitted your data files for FY {fiscal_yr} {fiscal_qtr} via <b> TANF Data Portal (TDP)</b>, \
        thank you; there is no further action needed.</p>
        <p>Action Requested:</p>\
        <ul>\
        <li>Please sign in to the <b><a href="https://tanfdata.acf.hhs.gov/">TANF Data Portal</a></b>.</li>\
        <ul><li><i>If you haven't signed into TDP in more than 170 days, please sign in to avoid having your account be deactivated due to inactivity.</i></li></ul>\
        <li><u>Upload and submit data files for FY {fiscal_yr} {fiscal_qtr} ({reporting_period}) by {due_date}, {current_calyr}</u>.</li>\
        </ul>\
        <p>Need help?</p>\
        <ul>\
        <li>Check out the <a href="https://tdp-project-updates.app.cloud.gov/knowledge-center/">TDP Knowledge Center</a> for specific guidance on <a href="https://tdp-project-updates.app.cloud.gov/knowledge-center/uploading-data.html">Submitting Data Files</a> and <a href="https://tdp-project-updates.app.cloud.gov/knowledge-center/faq.html">Frequently Asked Questions</a>.</li>\
        <li>Reach out to the <a href="mailto:TANFData@acf.hhs.gov">TDP support team</a> by replying to this email and we will follow up with you directly.</li>\
        </ul>\
        """

    return fiscal_yr,fiscal_qtr,due_date,reporting_period,current_calyr,email_content
robgendron commented 1 month ago

1 point remaining.