-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.py
33 lines (23 loc) · 988 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python
import datetime
from send_reports_email import create_reports
from send_reports_email import send_email
date = datetime.date.today().strftime("%m%d%y")
save_location = r"F:\PWF Development\Planned Giving\Reports\Planned Giving Luminate Interest " + date
extension = ".xlsx"
def create_file():
find_file_path = r"C:\Users\jhoover\Downloads\Planned"
macro_name = "Mail_Merge.cleanMailMergePG"
file = create_reports.CreateFile(find_file_path)
create_reports.ExcelMacro(file.original_file, macro_name, save_location)
file.delete_original_file(file.original_file)
def email_file():
emailto = "[email protected], [email protected]"
subject = "Planned Giving Interest Update " + date
body = "Hi Merrill,\r\rHere’s your excel for the week!\r\r-JordanBot"
attach = save_location + extension
email = send_email.SendEmail(emailto, subject, body, attach)
email.send()
if __name__ == "__main__":
create_file()
email_file()