pub async fn send_rfd_changelog() {
    // Initialize our database.
    let db = Database::new();
    let github = authenticate_github_jwt();
    let seven_days_ago = Utc::now() - Duration::days(7);
    let week_format = format!("from {} to {}", seven_days_ago.format("%m-%d-%Y"), Utc::now().format("%m-%d-%Y"));

    let mut changelog = format!("Changes to RFDs for the week {}:\n", week_format);

    // Iterate over the RFDs.
    let rfds = RFDs::get_from_db(&db);
    for rfd in rfds {
        let changes = rfd.get_weekly_changelog(&github, seven_days_ago).await;
        if !changes.is_empty() {
            changelog += &format!("\n{} {}\n{}", rfd.name, rfd.short_link, changes);
        }
    }

    // Initialize the SendGrid clVient.
    let sendgrid_client = SendGrid::new_from_env();

    // Send the message.
    sendgrid_client
        .send_mail(
            format!("RFD changelog for the week from {}", week_format),
            changelog,
            vec![format!("all@{}", DOMAIN)],
            vec![],
            vec![],
            format!("rfds@{}", DOMAIN),
        )
        .await;
}
/// Create a changelog email for the RFDs.
Create a changelog email for the RFDs.
Create a changelog email for the RFDs .
pub async fn send_rfd_changelog() {
    // Initialize our database.
    let db = Database::new();
    let github = authenticate_github_jwt();
    let seven_days_ago = Utc::now() - Duration::days(7);
    let week_format = format!("from {} to {}", seven_days_ago.format("%m-%d-%Y"), Utc::now().format("%m-%d-%Y"));
    let mut changelog = format!("Changes to RFDs for the week {}:\n", week_format);
    // Iterate over the RFDs.
    let rfds = RFDs::get_from_db(&db);
    for rfd in rfds {
        let changes = rfd.get_weekly_changelog(&github, seven_days_ago).await;
        if !changes.is_empty() {
            changelog += &format!("\n{} {}\n{}", rfd.name, rfd.short_link, changes);
        }
    }
    // Initialize the SendGrid clVient.
    let sendgrid_client = SendGrid::new_from_env();
    // Send the message.
    sendgrid_client
        .send_mail(
            format!("RFD changelog for the week from {}", week_format),
            changelog,
            vec![format!("all@{}", DOMAIN)],
            vec![],
            vec![],
            format!("rfds@{}", DOMAIN),
        )
        .await;
}
pub async fn send_rfd_changelog ( ) { // Initialize our database. let db = Database :: new ( ) ; let github = authenticate_github_jwt ( ) ; let seven_days_ago = Utc :: now ( ) - Duration :: days ( 7 ) ; let week_format = format ! ( " " seven_days_ago format ( " " ) Utc now ( ) format ( " " ) ) ; let mut changelog = format ! ( " \n " week_format ) ; // Iterate over the RFDs. let rfds = RFDs :: get_from_db ( & db ) ; for rfd in rfds { let changes = rfd . get_weekly_changelog ( & github , seven_days_ago ) . await ; if ! changes . is_empty ( ) { changelog += & format ! ( " \n \n " rfd name rfd short_link changes ) ; } } // Initialize the SendGrid clVient. let sendgrid_client = SendGrid :: new_from_env ( ) ; // Send the message. sendgrid_client . send_mail ( format ! ( " " week_format ) , changelog , vec ! [ format ( " " DOMAIN ) ] , vec ! [ ] , vec ! [ ] , format ! ( " " DOMAIN ) , ) . await ; }
Create a changelog email for the RFDs.
Create a changelog email for the RFDs .