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

Send group emails correctly #1112

Merged
merged 2 commits into from
Mar 5, 2017
Merged

Send group emails correctly #1112

merged 2 commits into from
Mar 5, 2017

Conversation

Sumukh
Copy link
Member

@Sumukh Sumukh commented Mar 5, 2017

These were previously 400'ing because we were passing a list when sendgrid expected a single string (which changed because we upgraded the sendgrid library version a while back)

The "right" way to do this is to use sendgrid personalizations - but that's an issue we can shelve for later #1084

if action == "accept":
group.accept(current_user)
subject = "{0} has accepted the invitation to join your group".format(current_user.email)
body = "Your group for {0} now has {1} members".format(assignment.display_name,
len(group.members))
group_action_email(group.members, subject, body)
members = [m.user.email for m in group.members]
send_emails(members, subject, body)
Copy link
Member Author

@Sumukh Sumukh Mar 5, 2017

Choose a reason for hiding this comment

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

We call send_emails at the bottom of each case - ideas for something better that's a bit more DRY?

@Sumukh
Copy link
Member Author

Sumukh commented Mar 5, 2017

Going to merge this since our existing implementation is broken - but a quick pass would be good.

@Sumukh Sumukh merged commit 407ea7e into master Mar 5, 2017
@Sumukh Sumukh deleted the send_emails_multiple branch March 5, 2017 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant