Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejection Email Automation #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Rejection Email Automation #17

wants to merge 1 commit into from

Conversation

cphalen
Copy link
Member

@cphalen cphalen commented May 23, 2022

Short Python script I used to test the new /rejection endpoint:

import requests

url = "http://localhost:5000/rejection"
data = {
    "recipients": [
        {
            "name": "Campbell",
            "email": "cphalen@seas.upenn.edu"
        }
    ],
    "directors": "Campbell & Hassan"
}

resp = requests.post(url, json=data)
print(resp)

@cphalen cphalen requested review from ArmaanT and davish May 23, 2022 19:59
def rejection():
form = request.json
if not rejection_schema.validate(form):
return Response(status=400)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to get a more detailed response for how the request is invalid?

msg.set_content(
"\n".join(
[
f"Hi {recipient_name},",
Copy link
Member

Choose a reason for hiding this comment

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

Do we only have 1 rejection email? I thought we had different ones for different stages

)

with smtplib.SMTP(host, 587) as server:
server.login(username, password)
Copy link
Member

Choose a reason for hiding this comment

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

This seems slightly inefficient/could cause problems since it's logging into our email for each individual rejection. I think it may make more sense to login only once.

Copy link
Member

Choose a reason for hiding this comment

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

ditto -- bulk rejection sounds like a better API for the endpoint, this function could just be called in the loop and passed the SMTP object.

[
f"Hi {recipient_name},",
""
"Thank you for taking the time to apply to Penn Labs! This semester's recruitment process was difficult, and unfortunately we were not able to accept your application at this time.",
Copy link
Member

Choose a reason for hiding this comment

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

Using Jinja or some other templating language would probably be better in the long run than adding the template in the code

"We know that rejections from clubs can be disheartening, but we sincerely hope that you continue building and looking for ways to improve the Penn experience. Many of our members were not accepted on their initial application attempt, but they continued to learn, and are now some of our most valuable contributors. On that note, we have a few bits of advice to help grow the skills and passions you very clearly have:",
"\t1. Identify a problem at Penn, then go out and solve it: There are so many problems at Penn you can solve and we want to see the amazing things you can do even outside of Penn Labs! We also have APIs for you to use!",
"\t2. Immerse yourself in the world of products: There are a lot of great resources out there to dive deeper into product development and design. Product Hunt and Dribbble are great places to find inspiration - find things you like and think about how they're built.",
"3. Build something: Seriously, anything. Even if it's not super cool at first, you'll learn an incredible amount in a short amount of time. Many of our developers started school with little experience, but over the course of a semester or even a break, picked up a new language and started building non-stop.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"3. Build something: Seriously, anything. Even if it's not super cool at first, you'll learn an incredible amount in a short amount of time. Many of our developers started school with little experience, but over the course of a semester or even a break, picked up a new language and started building non-stop.",
"\t3. Build something: Seriously, anything. Even if it's not super cool at first, you'll learn an incredible amount in a short amount of time. Many of our developers started school with little experience, but over the course of a semester or even a break, picked up a new language and started building non-stop.",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants