Coverage for website/activemembers/emails.py: 66.67%

6 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2025-08-14 10:31 +0000

1from django.conf import settings 

2 

3from utils.snippets import send_email 

4 

5 

6def send_gsuite_welcome_message(member, email, password): 

7 """Send an email to notify a member of G Suite credentials. 

8 

9 :param member: the member 

10 :param email: G Suite primary email 

11 :param password: randomly generated password 

12 """ 

13 send_email( 

14 to=[member.email], 

15 subject="Your new G Suite credentials", 

16 txt_template="activemembers/email/gsuite_info.txt", 

17 html_template="activemembers/email/gsuite_info.html", 

18 context={ 

19 "full_name": member.get_full_name(), 

20 "username": email, 

21 "password": password, 

22 "url": settings.BASE_URL, 

23 }, 

24 ) 

25 

26 

27def send_gsuite_suspended_message(member): 

28 """Send an email to notify a member of G Suite suspension. 

29 

30 :param member: the member 

31 """ 

32 send_email( 

33 to=[member.email], 

34 subject="G Suite account suspended", 

35 txt_template="activemembers/email/gsuite_suspend.txt", 

36 html_template="activemembers/email/gsuite_suspend.html", 

37 context={ 

38 "full_name": member.get_full_name(), 

39 "url": settings.BASE_URL, 

40 }, 

41 )