-
Notifications
You must be signed in to change notification settings - Fork 4
send email to bilf on new booking (#450) #451
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
Conversation
|
Should resolve #450 |
This comment was marked as resolved.
This comment was marked as resolved.
|
Surely I've fixed all the bugs now. Looks green on my end idk. |
maffe03
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help!
I think it might be better to duplicate some code rather than mess with the User_DB objects as they are scary and might do Database Stuff™, but overall it's good!
mailer/bilf_mailer.py
Outdated
| msg["Subject"] = "Ny kollegie-bilbokning / New council car booking" | ||
|
|
||
| # This will surely be super bad | ||
| fake_user = User_DB( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to just create a new send_mail_to_adress function instead which takes in an EmailStr instead of User_DB
mailer/bilf_mailer.py
Outdated
| html = html.replace("{{ booking.time }}", time_string) | ||
|
|
||
| if booking.council is not None: | ||
| html = html.replace("{{ booking.council_en }}", booking.council.name_en) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably unnecessary but maybe escape these as well? This is technically (admin) user input.
fix with new mailer function
maffe03
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Surely this well tested code doesnt break anything.
Pls especially double check mailer/bilf_mailer.py line 51