Skip to content

Feat: alumni email autoresponder #31

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

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion compiler_admin/commands/user/alumni.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from compiler_admin.commands.user.reset import reset
from compiler_admin.services.google import (
OU_ALUMNI,
USER_HELLO,
CallGAMCommand,
move_user_ou,
user_account_name,
Expand Down Expand Up @@ -33,7 +34,7 @@ def alumni(args: Namespace) -> int:
return RESULT_FAILURE

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

print("Resetting email signature")
# https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Send-As-Signature-Vacation#manage-signature
command = (
"user",
account,
"signature",
f"Compiler LLC<br />https://compiler.la<br />{USER_HELLO}",
"replyto",
USER_HELLO,
"default",
"treatasalias",
"false",
"name",
"Compiler LLC",
"primary",
)
res += CallGAMCommand(command)

print("Turning on email autoresponder")
# https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Send-As-Signature-Vacation#manage-vacation
message = (
"Thank you for contacting Compiler. This inbox is no longer actively monitored.<br /><br />"
+ f"Please reach out to {USER_HELLO} if you need to get a hold of us."
)
command = (
"user",
account,
"vacation",
"true",
"subject",
"[This inbox is no longer active]",
"message",
message,
"contactsonly",
"false",
"domainonly",
"false",
"start",
"Started",
"end",
"2999-12-31",
)
res += CallGAMCommand(command)

return res
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
]
requires-python = ">=3.11"
dependencies = [
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/GAMADV-XTD3.git@v7.00.05#subdirectory=src",
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/GAMADV-XTD3.git@v7.00.38#subdirectory=src",
"pandas==2.2.3",
"tzdata",
]
Expand Down
Loading