In: self.user_to_modify, dictionary Does: Sends email to user to be invited
(
self,
signup_link,
role_name,
note,
email)
| 418 | communicate_via_email.send(self.user_to_modify.email, subject, message) |
| 419 | |
| 420 | def invite_user( |
| 421 | self, |
| 422 | signup_link, |
| 423 | role_name, |
| 424 | note, |
| 425 | email): |
| 426 | """ |
| 427 | In: |
| 428 | self.user_to_modify, dictionary |
| 429 | |
| 430 | Does: |
| 431 | Sends email to user to be invited |
| 432 | |
| 433 | """ |
| 434 | |
| 435 | # We still notify here since the user doesn't exist... |
| 436 | |
| 437 | subject = f"Added to project {self.project_string_id}" |
| 438 | |
| 439 | message = f"You have been added to: {self.project_string_id} as an: {str(role_name)} \n" |
| 440 | |
| 441 | message += f"Create an account to get started here: {signup_link} \n" |
| 442 | |
| 443 | message += f"Added by {str(self.user_who_made_request.email)} \n" |
| 444 | message += f"With the following personal note:\n {str(note)}" |
| 445 | |
| 446 | # Careful, can't use self.user_to_modify here since user doesn't exist yet.... |
| 447 | communicate_via_email.send(email, subject, message) |