Skip to content

Commit ff043ee

Browse files
authored
Feat: alumni email autoresponder (#31)
2 parents 7b240f8 + ebab1ae commit ff043ee

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

compiler_admin/commands/user/alumni.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from compiler_admin.commands.user.reset import reset
55
from compiler_admin.services.google import (
66
OU_ALUMNI,
7+
USER_HELLO,
78
CallGAMCommand,
89
move_user_ou,
910
user_account_name,
@@ -33,7 +34,7 @@ def alumni(args: Namespace) -> int:
3334
return RESULT_FAILURE
3435

3536
if getattr(args, "force", False) is False:
36-
cont = input(f"Convert account to alumni for {account}? (Y/n)")
37+
cont = input(f"Convert account to alumni: {account}? (Y/n) ")
3738
if not cont.lower().startswith("y"):
3839
print("Aborting conversion.")
3940
return RESULT_SUCCESS
@@ -68,4 +69,48 @@ def alumni(args: Namespace) -> int:
6869
command = ("user", account, "turnoff2sv")
6970
res += CallGAMCommand(command)
7071

72+
print("Resetting email signature")
73+
# https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Send-As-Signature-Vacation#manage-signature
74+
command = (
75+
"user",
76+
account,
77+
"signature",
78+
f"Compiler LLC<br />https://compiler.la<br />{USER_HELLO}",
79+
"replyto",
80+
USER_HELLO,
81+
"default",
82+
"treatasalias",
83+
"false",
84+
"name",
85+
"Compiler LLC",
86+
"primary",
87+
)
88+
res += CallGAMCommand(command)
89+
90+
print("Turning on email autoresponder")
91+
# https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Send-As-Signature-Vacation#manage-vacation
92+
message = (
93+
"Thank you for contacting Compiler. This inbox is no longer actively monitored.<br /><br />"
94+
+ f"Please reach out to {USER_HELLO} if you need to get a hold of us."
95+
)
96+
command = (
97+
"user",
98+
account,
99+
"vacation",
100+
"true",
101+
"subject",
102+
"[This inbox is no longer active]",
103+
"message",
104+
message,
105+
"contactsonly",
106+
"false",
107+
"domainonly",
108+
"false",
109+
"start",
110+
"Started",
111+
"end",
112+
"2999-12-31",
113+
)
114+
res += CallGAMCommand(command)
115+
71116
return res

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
]
1212
requires-python = ">=3.11"
1313
dependencies = [
14-
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/[email protected].05#subdirectory=src",
14+
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/[email protected].38#subdirectory=src",
1515
"pandas==2.2.3",
1616
"tzdata",
1717
]

0 commit comments

Comments
 (0)