Search code examples
pythonpandasgoogle-sheetsgspread

I can successfully create a sheet with gspread with the data but the functionality to notify/email the users no longer works. Where's the error here?


The functionality of notifying users of the spreadsheet creation is not working. It used to work and I noticed in the documentation it has been updated 24th September 2019 so maybe this is a version problem?

I've tried variants of True/ yes in the notify section as per the documentation : https://buildmedia.readthedocs.org/media/pdf/gspread-pandas/latest/gspread-pandas.pdf - page 13

my_test_spread = Spread("My_sheet_"+date_format, create_spread=True, scope=['openid', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/spreadsheets'], creds=credentials,  permissions=["bob@test.co.uk|writer|True","roger@test.co.uk|writer|True","emily@test.co.uk|writer|True" ])

my_test_spread.df_to_sheet(control, index=False, sheet='Control', start='A1', replace=True)

I expect the users roger,bob and emily to receive an email on creation of the sheet

EDIT

I also have tried this outside of the gspread-pandas wrapper in just gspread. I tried the share method and the insert_permission method below. Neither have worked!

gc = gspread.authorize(credentials2)
sh = gc.open("My_sheet_"+date_format)
sh.share("bob@test.co.uk" ,perm_type="user" , role="writer",notify="True" ,email_message ="Here is this weeks list")
gc.insert_permission(sh.id, "bob@test.co.uk", perm_type="user", role="writer", notify=True, email_message="Here is this weeks list")

Solution

  • So I have changed nothing and it now works. I'm assuming a package update or something? I received three emails so each of the separate methods: share , insert_permission and Spread's default method now work!